Moodle quiz response is very slow when number of participants increased.

Moodle quiz response is very slow when number of participants increased.

by Lalit Thakur -
Number of replies: 2

Hi,

Moodle quiz is very slow or sometime freeze when participants inctrease to more than 70 or 80. We tried the quiz for 300 participants but strangely it strated responding slow or freezing. Quizs with few participants say 40-50 having no trouble.

We are using a high end server with following configuration.

CPU: Dual cpu xeon 40 core each.

RAM: 128 GB

Hard Drive: 2TB SSD

Ethernet: Gigabit

Moodle version: 3.4

While observing the resources of the server during the large quiz, we found that no resources were being used and stll it was responding slow. CPU usage were 5%, RAM usage were 3-4 GB only and network usage were showing 10-20 mbps only. 

Is there any configuration which we need to do in moodle to get all the server resources to be utilized optimally.

The server freeze only during the large quiz, it's working fine otherwise.

Average of ratings: -
In reply to Lalit Thakur

Re: Moodle quiz response is very slow when number of participants increased.

by S G -
We use the quiz engine quite extensively and we have faced a similar performance issue. The system would almost freeze when a new quiz is being generated from a large database of questions.

The issue got fixed to a large extent by tuning the PHP performance - through the php.ini file and MariaDB performance - through the Mariadb conf file.

There are plenty of Mariadb tuning tutorials on the net and the settings depend on your base server configuration.

The process mostly involved moving the resource / memory settings from default to higher levels.

I will not be able to provide specific details since I am not so tech savvy, but I remember the person who tuned the system mentioning that since there were no Moodle specific tuning guides / tutorials readily available, he used some tutorials meant for optimizing PHP & MariaDB performance for large Wordpress sites; and it worked for Moodle also.

All the best !
Average of ratings:Useful (1)
In reply to S G

Re: Moodle quiz response is very slow when number of participants increased.

by Daniel Thies -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The quiz has to write to the database a couple times for each question in quiz for every student. The number grows as product of students and questions. Tuning the database can increase the number greatly, but that has limits.

Another approach is to stagger the start of the quiz slightly. There is an access plugin Delayed attempts in quizzes. There are also a number of ways to to that without special plugins.
Average of ratings:Useful (3)