AWS EFS for moodledata is unbelievably slow

AWS EFS for moodledata is unbelievably slow

Anuvindh _ -
Number of replies: 11

Hi Team,

First , thank you for your time!

i am really facing a huge problem with EFS in AWS for moodledata. it's freaking slow😭 for administration.



i have tried Memcache and Redis for caching, still no hope. also tried S3fs-fuse. unfortunately, none of them is helping me.

i feel like I have misconfigured, can someone please guide me to the best way to keep moodledata folder for scaling with multiple Ec2?



 

Ngā whakawākanga toharite: -
In reply to Anuvindh _

Re: AWS EFS for moodledata is unbelievably slow

Visvanath Ratnaweera -
Pikitia o Particularly helpful Moodlers Pikitia o Translators
Hi

Is it a condition that Moodle should be on AWS? Otherwise there are many alternatives. Moodle runs quite decently even on a Raspberry Pi. See http://www.syndrega.ch/blog/#benchmarking-moodlebox-on-different-raspberry-pi-models.
Ngā whakawākanga toharite: Useful (1)
In reply to Visvanath Ratnaweera

Re: AWS EFS for moodledata is unbelievably slow

Howard Miller -
Pikitia o Core developers Pikitia o Documentation writers Pikitia o Particularly helpful Moodlers Pikitia o Peer reviewers Pikitia o Plugin developers
I've run Moodle on AWS without any issues.

Many people go out of their way to make it complicated. You can just get a plain, ordinary Ubuntu instance and install LAMP and then Moodle. Works perfectly.
Ngā whakawākanga toharite: Useful (2)
In reply to Visvanath Ratnaweera

Re: AWS EFS for moodledata is unbelievably slow

Anuvindh _ -
when I think about Scalability, reporting and CapEx etc is not an option for our company

am using SES for SMTP also using multiple Moodle servers. manging all these with monitoring solutions like cloud watch and many more aws services.
Consider all the extras, its cheap and easy to manage in AWS.
Ngā whakawākanga toharite: -
In reply to Anuvindh _

Re: AWS EFS for moodledata is unbelievably slow

Justin Hunt -
Pikitia o Particularly helpful Moodlers Pikitia o Plugin developers
Are you sure that the cache is not on the EFS drive? It sounds like that is the problem.

As an alternative and simpler solution, one user suggested to use GFS2 (clustered file system) instead of EFS+Redis/memcache.
https://moodle.org/mod/forum/discuss.php?d=354259
I thought that was a pretty interesting approach. But I have not tried it yet
Ngā whakawākanga toharite: Useful (4)
In reply to Justin Hunt

Re: AWS EFS for moodledata is unbelievably slow

Anuvindh _ -
Will do testing with GFS2 and will update soon with results, thank you
Ngā whakawākanga toharite: Useful (1)
In reply to Anuvindh _

Re: AWS EFS for moodledata is unbelievably slow

Nadav Kavalerchik -
Pikitia o Core developers Pikitia o Plugin developers Pikitia o Testers Pikitia o Translators
I am using AWS with moodledata on EFS, and although it is relatively slow comparing it with ESB, it is good enough for Moodle.
It seems, maybe, that your code is on EFS, and that might be making it slow.
It should be on the local disk of each EC2 Moodle instance.
Also, please check that you have not passed the daily bursting limit of EFS, and if needed, try to buy reserved quota.

Please see some more information about setting up auto-scaling Moodle infrastructure on AWS:

Cloud infrastructure for high concurrency
https://moodle.com/wp-content/events/mootglobal19/Cloudinfrastructureforhighconcurrency.pdf

Hosting high availability Moodle on AWS
https://github.com/aws-samples/aws-refarch-moodle
https://developerck.com/moodle-horizontal-scalable-aws/
https://mxmartempresarial.com/caso-de-estudio-univa.html
https://aws.amazon.com/es/blogs/aws-spanish/despliegue-de-moodle-en-alta-disponibilidad-en-aws/

Moodle Bitnami single server on AWS
https://aws.amazon.com/blogs/publicsector/accelerate-remote-learning-minutes-moodle-aws/

Moodle HA setup using docker over AWS
https://ktree.com/blog/moodle-ha-setup-using-docker-over-aws.html

https://aws.amazon.com/efs/features/infrequent-access/

Auto-Scaling Moodle Architecture on AWS 2015
https://www.erichartzog.com/blog/horz-scale-moodle

AWS Elastic Beanstalk
https://aws.amazon.com/elasticbeanstalk/
https://github.com/Tulkis/aws-ebs-moodle
Ngā whakawākanga toharite: Useful (4)
In reply to Nadav Kavalerchik

Re: AWS EFS for moodledata is unbelievably slow

Howard Miller -
Pikitia o Core developers Pikitia o Documentation writers Pikitia o Particularly helpful Moodlers Pikitia o Peer reviewers Pikitia o Plugin developers

"I am using AWS with moodledata on EFS, and although it is relatively slow comparing it with ESB, it is good enough for Moodle."

I'm sorry but I think this is *generally* poor advice. Cache performance is absolutely critical to Moodle sites. The easiest way to speed up your page load time is to get a proper cache. This applies to pretty much anybody that isn't using fast, local storage for 'moodledata'. EFS *might* be fast enough (I have very limited experience of cloud computing) but in general shared storage isn't.

Ngā whakawākanga toharite: Useful (1)
In reply to Howard Miller

Re: AWS EFS for moodledata is unbelievably slow

Nadav Kavalerchik -
Pikitia o Core developers Pikitia o Plugin developers Pikitia o Testers Pikitia o Translators
Hello Howard Miller,
From my experience, and from a lot of other Moodle administrators that uses AWS, this is the only way to handle a cluster of Moodle instances that must have a shared storage for a shared moodledata folder. there is no way around it.
Do not use FUSE with S3 (which is an object storage) as it is not stable enough for moodledata, which is also not a block storage in essence.

If you have a relatively small and single Moodle instance, you should obviously put the moodledata on a local EBS, but then, you are not really enjoying the benefits of AWS and its managed services. You might better off using some other low cost hosting service. (you can checkout bitnami.com for ready made Moodle instances)

Using cache is somewhat a separate issue, and of course you must use it too.
In case of using a shared EFS, I do not recommend you use moodledata for MUC cache. You should use REDIS.
Make sure $CFG->cachedir has as little files in it as possible. just the configuration files. it must be on a shared EFS when using a Moodle cluster.
Make sure $CFG->localcachedir is using a local EBS volume on you EC2 Moodle instance.
We use REDIS for user session cache and also for MUC (application & session) cache. in AWS it is called ElastiCache.
REDIS is much more mature, stable and featureful comparing to memcached, and I recommend you use it.
And obviously, OPCache for PHP, and make sure you tune it from time to time.

EFS can be provisioned, to get higher performance, but it will cost you!
Ngā whakawākanga toharite: Useful (3)
In reply to Nadav Kavalerchik

Re: AWS EFS for moodledata is unbelievably slow

Howard Miller -
Pikitia o Core developers Pikitia o Documentation writers Pikitia o Particularly helpful Moodlers Pikitia o Peer reviewers Pikitia o Plugin developers
As I mentioned - I'm not an AWS user (or anything similar) so I shall defer to your knowledge.
Ngā whakawākanga toharite: -
In reply to Nadav Kavalerchik

Re: AWS EFS for moodledata is unbelievably slow

Anuvindh _ -
awesome that's quite a lot of info, I had considered for NFS with an EC2 not yet tested though. will try that too @Auto-Scaling Moodle Architecture on AWS 2015
Ngā whakawākanga toharite: -
In reply to Anuvindh _

Re: AWS EFS for moodledata is unbelievably slow

Anuvindh _ -
Thank you everyone, for the help and support. glusterfs is the finest solution. Done some testing - working like a cheetah


Ngā whakawākanga toharite: Useful (3)