Hello
We are running Moodle on AWS. We have recently noticed high Time To First Byte measurements when loading courses and activities. This is not always repeatable. Sometimes the TTFB is < 2 seconds.
We are running all our exams on Moodle because we can't hold in-person exams (for obvious reasons). We use AWS Auto Scaling to scale out in the morning to cope with the load, and scale in again in the evening.
Right now (the evening in the UK), we have instances that have been running for a while and TTFB is consistently under 2 seconds.
This makes us suspect that the instances we start in the morning have cold local caches, and this is making the initial compilation of the courses, activities, etc, very slow.
We use ElastiCache (Redis) for the shared MUC, and APCu locally on the instances to cache MUC entries that don't need to be shared by all instances. We have also defined localcachedir
to be local to the instance. localcachedir
contains the usual stuff: JavaScript, theme files, and PHP generated by Mustache
We plan to run some tests to see if un-definining localcachedir
and/or using Redis for all MUC, including stuff that can be local to each instance. But I'm wondering if anyone already has some experience with this and can say: yes, it's better not to have things cached locally on instances that don't live very long.