Moodle + AWS EFS + filecachesd is it recommended?

Re: Moodle + AWS EFS + filecachesd is it recommended?

by Chris Fryer -
Number of replies: 1

Hi Christos

I think there are four separate answers to your question smile

  1. Ensure you are not using the filesystem for sessions. Since you're on AWS, you can use ElastiCache (either Memcached or, if you're using Moodle 3.2 or newer, Redis)

  2. EFS performance is proportional to the size of the filesystem, i.e. the more you store, the faster it goes. One trick is to make a monster file of zeroes, and the filesystem will go faster. There's also the usual myriad "burst credits" and "provisioned IOPS" options for you to work through. Have a look here: https://docs.aws.amazon.com/efs/latest/ug/performance.html

  3. Caching your moodledata files locally on the web servers will be fine, if you restrict your caching strategy to the filedir directory. Each file in Moodle is named on the filesystem according to its SHA1 digest. This is unlikely to collide with a different file. Indeed, if you upload exactly the same file in a different location, the new location is only a reference to the original file (a bit like a symbolic link, but in the Moodle database). More info here: https://docs.moodle.org/dev/File_API_internals

  4. You probably don't want to store the Moodle application on the EFS. Since that changes rarely, you should look at creating an AMI that has your version of Moodle and your preferred plug-ins already installed, and using that AMI in an auto-scaling group.

In short, you'll be fine to cache moodledata/filedir locally, but have a look at ways to make your EFS go faster.

Average of ratings: Useful (3)
In reply to Chris Fryer

Re: Re: Moodle + AWS EFS + filecachesd is it recommended?

by Ben Kahn -
I agree that Moodle code should not be stored in EFS. I would just add that unless you are using a cluster of EC2 servers in an auto-scaling group you do not need to use EFS for Moodle data either. For smaller sites, it might be better to run a single EC2 instance and attach an EBS volume for data. Granted with this configuration you are not fully taking advantage of the flexibility, durability and scalability of the cloud. But for a small site, EFS might not really make sense.