Hardware and performance

 
 
Picture of CP Lau
mdl_cache_text causes the performance bottlement
 

We have done a load test of 1500 active users in an hour on Moodle 2.4 (Load balancer + 5 web servers + 1 MySQL 5.5 with innodb). The test plans included both reading (e.g. notes, forum) and submitting (e.g. quiz, assignment, forum). We find that the performance bottleneck is caused by the table locking of mainly 3 tables in MySQL 5.5, mdl_cache_text, mdl_grade_item and mdl_forum_discussions. Among them, mdl_cache_text has the most serious table locking problem (there is even deadlocking).

We find that mdl_cache_text is used by almost each activity, including assignment, forum, choice, quiz, feedback, etc. The data in mdl_cache_text are being read and updated very frequently by Moodle. The data in mdl_grade_item and mdl_forum_discussions are also being read and updated frequently by Moodle. Thus, we believe that the long table locking time is due to many simultanenous read and write operations on the same rows of these tables given that the innodb row-level shared (for reading) and exclusive (for writing) locks in MySQL are in conflicting state.

May i ask how we can overcome this performance bottleneck in Moodle? Besides, does Moodle HQ have any plan to incorporate the mdl_cache_text table in the future Moodle 2.4 MUC implementations?

Thanks a lot 

 
Average of ratings:Useful (1)
Tim at Lone Pine Koala Sanctuary
Re: mdl_cache_text causes the performance bottlement
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Admin -> Plugins -> Filters -> Common filter settings and set Text cache lifetime to No.

(Whether text cache is a net gain or loss depends on which filters you are using, and how your servers are set up. The default of having it enabled is probably a good thing for small sites, but bad for big sites.)

Acutally, I think the Performance settings docs page gives the wrong advice about this. Should we change what it says there?

Yes, there are pland to MUCify this. See MDL-34347 and MDL-37316.

 
Average of ratings:Useful (1)
Picture of CP Lau
Re: mdl_cache_text causes the performance bottlement
 

Dear Tim,

    I have tried your recommendation. The result is very great. Big sites should have this option disabled rather than enabled by default. And Moodle has given wrong advice about this.

    Now, there is no table locking issue with mdl_cache_text as this option is disabled. However, there are still serious table locking issues with mdl_grade_item and mdl_forum_discussions. Is there any way to improve them as well? And does Moodle have any plan to improve them in the future?

   Thanks a lot.

 

 

   

 
Average of ratings:Useful (1)
Picture of CP Lau
Re: mdl_cache_text causes the performance bottlement
 

 Thanks Tim. I will perform the load test again with this option turned off.

I will give you the result later.

 
Average of ratings: -