Moodle 3.9 Performance

Moodle 3.9 Performance

Sander Bangma發表於
Number of replies: 26

Hi All,

We've made a number of good performance enhancements in Moodle 3.9 and I'm keen to get wider community feedback on the effectiveness of them out in the wild. 

In particular issues like reducing session locks can have a big impact on large sites.

We're keen to hear about your experience with 3.9 so far and if you can share test results/statistics and tips for everyone to benefit would be very much appreciated! 微笑

評比平均分數:Useful (4)
In reply to Sander Bangma

Re: Moodle 3.9 Performance

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
The OU will upgrade to 3.9 in December. We'll try to remember to get back to you then!

I hope that some people can get back to you with some numbers earlier than the.
In reply to Tim Hunt

Re: Moodle 3.9 Performance

Ивица Лазаревић發表於

I have small VPS (2GB RAM, 50GB SSD) and older Moodle 3.6 and Moodle 3.8 which works perfect. I am using Postgresql 10.13. I have just installed Moodle 3.9 and performance is very bad on clean install. It takes few seconds to open any page 傷心.

In reply to Ивица Лазаревић

Re: Fresh Moodle 3.9 takes few seconds to open any page

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
In reply to Visvanath Ratnaweera

Re: Fresh Moodle 3.9 takes few seconds to open any page

Ивица Лазаревић發表於

Sorry, my bad. Everthing is fine with 3.9, I tought it was clean install but my colegue turned on Theme designer mode so Moodle did not use cache. Now it is as fast as older versions (or maybe faster). Thank you for the reply!

In reply to Ивица Лазаревић

Re: Fresh Moodle 3.9 takes few seconds to open any page

Walter Byrd發表於
Could you tell me how many users you can have on your site at one time, and still get good performance? Any idea how well your site would perform if you had 1GB of memory instead of 2GB?
In reply to Walter Byrd

Re: Fresh Moodle 3.9 takes few seconds to open any page

Ивица Лазаревић發表於

I think the maximum number of users at one time was about 120 students doing exam. I did not test how it would perform for more. For my usecase 1GB would be sufficient, but I have a whole bunch of low trafic web sites on my Linode beside Moodle. The bigest problem that I have right now is disk usage. Moodledata folder consumed 25GB filled with assignment images. After course resets moodledata retained 15GB of those assignment files (assignsubmission_pdf), for which I dont know what is the right way to clean.

評比平均分數:Useful (1)
In reply to Ивица Лазаревић

Re: Fresh Moodle 3.9 takes few seconds to open any page

Walter Byrd發表於
Thank you for reply. I wonder if you could put MoodleData on AWS?
In reply to Walter Byrd

Re: Fresh Moodle 3.9 takes few seconds to open any page

Ивица Лазаревић發表於

I havent been using AWS so I can't tell for sure, but I think you could use EBS https://aws.amazon.com/ebs/. I am not sure about S3. I do not plan to switch to AWS since Linode has similar offering both for object storage (compatible with S3) and block storage. I will consider in future block storage from Linode (1$ per 10GB). My problem is disk space leaking, so problem would remain no matter how much disk space do I have.

評比平均分數:Useful (1)
In reply to Ивица Лазаревић

Re: Fresh Moodle 3.9 takes few seconds to open any page

Basil Gohar發表於

I noticed that you are looking at Linode and interested in using Object Storage for Moodle.  I have the same interest, and what I've found so far is that Moodle's Amazon S3 repository support is strictly limited to Amazon unless I have missed something.  That is to say, you cannot specific S3-compatible endpoints, you must pick from specific, hard-coded Amazon ones.

I'd love to be proven wrong, because I plan to ask specifically about this myself.  I just figured I should comment here first since you are looking for the same kind of support.

In reply to Basil Gohar

Re: Fresh Moodle 3.9 takes few seconds to open any page

Ивица Лазаревић發表於
In the end I did not use Linode Object Storage. Instead I changed provider. For the roughly same amount of money I got 160GB SSD and 8GB RAM with 2 dedicated cores from Netcup. This is the plan I purchased: https://www.netcup.eu/bestellen/produkt.php?produkt=2620 Compared to Linode it looks too good to be true, but so far it is working great. I ran Moodle Benchmark on the same site on Linode and Netcup and got a 3x better score on Netcup! With the new provider I don't have an Object Storage option any more, instead I can mount additional NFS storage (up to 1TB) and use it without any additional configuration on Moodle side, and the price for NFS is less than Linode Object Storage! I have not tested the NFS option yet. SSD is super fast (compared to Linode) but I am worried about NFS. I guess it should be fine if I move only filedir directory to NFS and keep cache and other folders on SSD. For now I will upgrade to the 320GB plan when I hit 160GB. I would like to hear if someone has experience with moodledata/filedir mounted on NFS.
In reply to Ивица Лазаревић

Re: Fresh Moodle 3.9 takes few seconds to open any page

Alain Raap發表於
We had experience with moodledata/filedir on NFS, it's difficult to tune and to get a fast and reliable connection with the NFS server. We also had a problem with an antivirus program installed that hang up our server (with NFS server) with kerneltimeouts at random moments, so be aware of that if you choose for NFS as a solution. I posted some messages in the forums here about how we configured the NFS share, that was fast enough for us: https://moodle.org/mod/forum/discuss.php?d=362709&mode=3
評比平均分數:Useful (1)
In reply to Walter Byrd

Re: Fresh Moodle 3.9 takes few seconds to open any page

Kapila Jayasinghe發表於
We use EFS to store MoodleData. I/O can make things really slow rarely (especially when updating/upgrading etc). This is the only feasible option when you use auto-scaling.
In reply to Sander Bangma

Re: Moodle 3.9 Performance

Rick Jerz發表於
Particularly helpful Moodlers的相片 Testers的相片
Sander, my Moodle is quite small, around 12-15 courses each year, about 500 total students in these courses each year. So I don't think that session locks have ever affected my Moodle. I upgraded to Moodle 3.9 on 6/15/20, from Moodle 3.8.3+ (Build 20200522), and do not notice any "performance" changes. But this is good, my Moodle is not any slower! 😀 🏅






評比平均分數:Useful (1)
In reply to Sander Bangma

Re: Moodle 3.9 Performance

Enrique Castro發表於
Core developers的相片
Hi:
At ULPGC I have been maintaining a 3.9dev site with our customizations since january. Everything has been working OK. HI have several test sites with very good performance compared to 3.5 in the same system.

Now we are working in a pre-production system to be moved to production in July with 3.9. And now we have a problem. The system is OK for regular users working on course pages. But as soon as an Admin user goes to the admin interface and uses admin pages to change settings, the performance for that user is catastrophic, terribly slow. Page load times are in minutes values.

Any idea??
In reply to Enrique Castro

Re: Moodle 3.9 Performance

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
What sort of caching setup are you using?

It could be that the changes that the admin makes are causing come caches to be purged, and this is slowing things down until the cache has re-warmed. (And if you are using memcache, its limitations make the problem much worse.)
In reply to Enrique Castro

Re: Moodle 3.9 Performance

Ken Task發表於
Particularly helpful Moodlers的相片

Are these admin users admins in all sites?

IF so, cookie prefix the same or different for each site.  Browser cache can get confused/large and has to sort out more for admin level users.

My 2 cents.

'SoS', Ken

評比平均分數:Useful (2)
In reply to Sander Bangma

Re: Moodle 3.9 Performance

Bishwanath Jha發表於

Hi All,

First for all thanks for making such great improvements in terms of performance by Moodle Team. Lot of slow queries are gone now.

We have updated our moodle from 3.8 to 3.9 on 19th July and suddenly we have started facing two issues which was not faced before. We are using Redis(Elastic cache) for session, Aurora MySql with autoscaling and EC2 linux instances with autoscaling. We have quite good load coming to server during the day time like say 1000+ students are hitting on the same time.

1) Getting huge number of slow queries logged like below and query time is around 25 to 80 sec. Which is a big problem for us.

# Time: 200720  2:44:31
# Query_time: 80.011756  Lock_time: 0.000000 Rows_sent: 1  Rows_examined: 0
SET timestamp=1595213071;
SELECT GET_LOCK('418865d95a81bf4014128aa00b9026703cd40a13', '97') AS locked;
Interesting part is the key string inside the get lock function is same in the all slow lock query. Not sure if we are using Redis for session then why lock is required in database.

2) We are using localcache directory. The size of the directory is ever growing like atm its 32GB. It was not making localcache earlier.

$CFG->localcachedir = '/var/www/cache';  // Intended for local node caching 

Not finding solution so far and its not possible to go back to the previous version as well. Something sure has been cause after upgrade only. Looking forward to your help.

Thanks,

Bishwanath

In reply to Bishwanath Jha

Re: Moodle 3.9 Performance

Graeme Henderson發表於

How are you using AWS Aurora MySql if it is not supported in version 3.9?  It looks like it will only be supported from version 3.10

In reply to Graeme Henderson

Re: Moodle 3.9 Performance

Kapila Jayasinghe發表於
We have been using Aurora-MySQL (Engine version 5.7.mysql_aurora.2.07) for a couple of years with Moodle 35 (production) and now with Moodle 39 (in Dev mode) without any issues. AWS EC2/RDS/ElastiCache (Redis)/EFS
In reply to Bishwanath Jha

Re: Moodle 3.9 Performance

Bishwanath Jha發表於
Replying to my own comment as the issue #1(GET_LOCK issue) is resolved, it was caused due to CRONS running in parallel.
In reply to Sander Bangma

Re: Moodle 3.9 Performance

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Hi Sander

We upgraded from 3.5 to 3.9 last week. A group of active teachers tested 3.9 for almost three months - we started with 3.9dev. Their main concern was the functionality, most importantly whether 3.9 is "downward compatible". No concerns there, except for some uncertainty with H5P and Safe Exam Browser. Also some "false" predictions from Insights (Analytics) irritated the managers.

I haven't done any systematic performance comparisons. But subjectively, quickly navigating as the admin, 3.9 feels snappy just as the 3.5. Nightly automatic course backups take roughly the same duration. No synchronized on-line exams yet. The academic year starts tomorrow. Will report if something unexpected comes up.

P.S. I thought you expected quantitative results of performance comparisons between 3.9 and its predecessors - not to be an assorted catch-all thread for all the performance problems people have in the latest release. But that is happening. I think the subject "Moodle 3.9 Performance" is too suggestive. Being a sticky post makes matters worse. It would be a pity, if enquiries on performance problems first land here and the moderator have separate them.
In reply to Sander Bangma

Re: Moodle 3.9 Performance

Abror Aliboyev發表於

Hi We recently upgraded to moodle 3.9.1 And started new academic year with it. Site loads fast with few users. But usually there are 300 users online. And we are having problems on handling too many queries. I turned debugging on and saw that the problem is with our db. 

problem

And with few users debugger shos this 

with few users

I didn't understand what is causing a problem.

Need your help.

評比平均分數:Useful (1)
In reply to Abror Aliboyev

Re: Moodle 3.9 Performance

Tomasz Muras發表於
Core developers的相片 Plugin developers的相片 Plugins guardians的相片 Translators的相片

What is the database you're using? If it's MySQL then turn on "slow queries" logging and see what is logged there, when you open this site.

In reply to Sander Bangma

Re: Moodle 3.9 Performance

Eric Taylor發表於
176 points on an Azure Windows instance. As always, the primary tip is to move your caching folders to a tiny HD partition where AV is disabled because it complete hozes cache writes.