Moodle Server Performance [400 concurrent students]

Moodle Server Performance [400 concurrent students]

by Mohammad Yaseen -
Number of replies: 3

Dear all

We will be having an online quiz for around 400 concurrent students. They will be logging into the examination platform almost at the same time. I will be very grateful if you can suggest recommended and best settings for the server (PHP, MySQL, and Apache) to run the online quiz as smoothly as possible.

We have the following installation of Moodle:

  • Server: Ubuntu 18.04.4 LTS
  • Available Memory: 16 GB
  • PHP version: 7.4
  • PHP-FPM Enabled
  • PHP MPM Enabled: MPM_Worker
  • Database: MySQL 5.7.36
  • Web Server: Apache

Any tips and recommendations are highly appreciated.

Regards

Average of ratings: -
In reply to Mohammad Yaseen

Re: Moodle Server Performance [400 concurrent students]

by Ken Task -
Picture of Particularly helpful Moodlers

Install MySQL tuner.

https://www.linode.com/docs/guides/how-to-optimize-mysql-performance-using-mysqltuner/

On a single server - DB + web - it's a balancing act between Apache and DB server.   The more memory you can allocate to MySQL/your Moodle DB to be able to run in memory the better - less IO = faster.

Check apache for modules you are not using for Moodle and un-load them.

Running any additional services you don't need on testing day?   FTP?  If so, consider never launching them.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Mohammad Yaseen

Re: Moodle Server Performance [400 concurrent students]

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Saw that you started with 500 concurrent users, "Best Memory Settings" https://moodle.org/mod/forum/discuss.php?d=414650. What was the final result?

You must be familiar with the Performance FAQ, you'll see that there is no formula for 'N concurrent users': https://docs.moodle.org/en/Performance_FAQ#What_are_the_requirements_for_N_users.3F. Still your number, 400, is manageable as opposed to numbers starting from upper thousands we see here now and then. As a very rough estimation in your range https://docs.moodle.org/en/Performance_FAQ#What_hardware_should_I_buy_for_.27n.27_concurrent_users.3F says, "your Moodle site may only handle as few as 10-20 concurrent users per GB of memory", so 160 to 320 for 16 GB. I would say, you can give it a try.

The success will depend on many factors. Will those 400 (try to) open the quiz during a couple of seconds or a couple of minutes? How heavy is the exam? Does it contain just the standard question types in the quiz module? Will the questions contain heavy images, or even videos? How big is the first quiz page? One question? Ten questions? Fifty questions?

The success will also depend on how well you set up the server. As Ken wrote earlier, having both the web server and the database server in a single machine is a balancing act. You need a good system administrator. Even then, no system admin can set up the server in one go. You have to put it to use, monitor the load during not so critical loads, come back and change settings. May be to add RAM, may be add a caching mechanism like Memcache/Memcached or Redis, etc.

The system administrator can also over do and make things worse. Right now, I am analyzing an overly complicated server "infrastructure". I bet I could get ten times the performance from the hardware if I start from scratch.