Configure caching for your site
  • 05 Jul 2023
  • 2 minutes to read

Configure caching for your site


Article Summary

Once you have taken the time to understand how caching works in Totara, you may be ready to configure caching for your site. This can be a tricky process, and unfortunately there is no step-by-step guide to this. How caching can be best configured for a site depends on the site and the resources available to it.

Below are some points to help optimise cache performance:

  • Plan it. It's a complex thing. Understand your site, understand your system, and carefully think about how users will be using it all.

  • If you've got a small site the gains aren't likely to be significant, but if you've got a large site then getting this right can lead to a substantial boost in performance.  

  • When looking at cache backends, really research the advantages and disadvantages of each. Keep your site in mind when thinking about them. Depending upon your site you may find that no one cache backend is going to meet the entire needs of your site, and that you will benefit from having multiple backends at your disposal.
      
  • Things aren't usually as simple as installing a cache backend and then using it. Pay attention to configuration and try to optimise it for your system. Test it separately and have an understanding of its performance before discussing related issues with Totara. The cache allows you to shift load off the database and reduce page request processing. If, for instance, you have memcache installed but your connection has not been optimised for it, you may well find yourself in a losing situation before you even tell Totara about the memcache server.
      
  • When considering your default store instances keep in mind that they must operate with data sets of varying sizes and frequency. For a large site you should look at each cache definition and map it to a store that is best suited for the data it includes and the frequency of access.
      
  • When mapping store instances to caches, carefully consider the cache you are mapping and make a decision based upon what you understand of your site, and what you know about the cache.
      
  • Test your configuration. If you can stress test it, even better! If you turn on performance information Totara will also print cache access information at the bottom of the screen. You can use this to visually check the cache is being used as you expect, and it will give you an indication of where misses etc. are occurring.
      
  • Keep an eye on your backend. Totara doesn't provide a means of monitoring a cache backend, and that is certainly something you should keep an eye on. Memcache, for instance, drops least-used data when full to make room for new entries. APC, on the other hand, stops accepting data when full. Both will impact your performance if full, and you're going to encounter misses. However APC performs poorly when full, but it is much faster.

© Copyright 2024 Totara Learning Solutions. All rights reserved. Some content originally obtained via GPLv3 license and continues to be available under GPLv3. All other content is the sole copyright of Totara Learning Solutions. 


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.