Moodle Concurrent user

Moodle Concurrent user

Naveendurai K -
回帖数:5

Hai

We have hosted in cloud with the following configurations

4 physical cores
AMD EPYC 7282 2.8 GHz
32 GB RAM
240 GB NVMe SSD
500 Mbit/s port

We had a Quiz Contest for 500 users .But once the concurrent user count reaches 150 ,i got an error

"

This site can’t be reached

….took too long to respond.

ERR_CONNECTION_TIMED_OUT"


The above error is diplayed once we start attempting the Quiz .So i made modification in mysql settings 

max_connections=151(default)

and i changed to 

max_connections=1500

.Does this change solve my purpose having atleast 1000 concurrent users taking quiz activity at the same time?


Kindly suggest me if my modification is correct ?

回复Naveendurai K

Re: Moodle Concurrent user

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
Hi

_Physical_ cores in the cloud? Never seen that!
微笑

No, seriously, AMD EPYC 7282, 5600 BogoMIPS, is a powerful CPU. According to an "undocumented" rule of thumb in this forum, "10-20 concurrent users per GB RAM", your 32 GB should give you 320 to 640 concurrent (quiz) users. Considering the NVMe SSD storage the number should be on the higher side. The bandwidth should be more than enough too, unless your quiz is multi-media heavy.

All that suggests, your sever is under performing. The starting point is the https://docs.moodle.org/en/Performance_recommendations and the https://docs.moodle.org/en/Performance_FAQ. Past discussions in this forum make a real knowledge base too.

And you need to provide the whole software story: OS, web server, DBMS, PHP,installation notes. Any tuning, changes done. Also how do your quiz users ramp up? I mean, are all 1000 candidates waiting for the exam to go on-line and click the load button within seconds? What did your monitoring system record in this situation?

The error is not the database being unreachable, but the web server. Better be sure before your treat an imagined ailment. 眨眼

Also, finally whether this is a programming competition with SQL, VPL, etc. Saw your other post: https://moodle.org/mod/forum/discuss.php?d=409249.
回复Visvanath Ratnaweera

Re: Moodle Concurrent user

Naveendurai K -
Hai
Thanks for your reply
We use ubuntu 16.04
Moodle 3.9
Mysql

The activity is a Quiz activity with MCQ type questions

We have VPL ,but we havent tested with VPL
回复Naveendurai K

Re: Moodle Concurrent user

Alex Rowe -
It's probably not correct.

Have you performed any PHP or MySQL configuration changes to make correct use of your RAM?

I believe a default Ubuntu type setup without any config changes can only handle about 100 or so users.

What errors were you seeing, or where was the bottleneck? Was MySQL saying it reached max connections, if so then you might just need to raise what you did (not to 1500 though).
回复Alex Rowe

Re: Moodle Concurrent user

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
Hi Alex and all

I had a first-hand look off-list. And the problem was... Well, there was no problem, just everything was default: Linux 4.15.0-112-generic, Apache/2.4.18 (Ubuntu) with MPM prefork, missing APACHE_LOCK_DIR and many other similar parameters, PHP 7.4.8 on Apache, no external cache (other than OpCache and MUC), etc.

Basically increasing the MaxRequestWorkers to 512 and making the Innodb buffer pool bigger than the DB did the trick. The busiest exam they had so far, 257 candidates sitting for a programming assessment of 30 min duration which was open only for 35 min, ran without a single complaint. All finished the exam. Must say that all the candidates were accessing the exam through mobile broadband. So the network was only lightly loaded.

The number of processes and memory utilization graphs are shown below.
- The full length of the graph is 60 min. The exam opening at 25 min in to it (measurement no. 250)
- No. of processes: Apache is in blue, MySQL in red (only 2 procs constatntly), total no, of all processes in green
- Memory consumption: in GB, same colour coding





The information was gathered through standard Unix commands like ps and from tools in the sysstat package. The graphs were created quick-and-dirty with the JpGraph https://jpgraph.net/ package.

What surprises me is the average size of an Apache process. It varied from 50 to 75 MB over time. Anybody knows Why? BTW, we are not too far from our forbidden "10-20 concurrent users per GB" rule. 眨眼

P.S. Only later I came to know that their Virtual Programming Lab https://vpl.dis.ulpgc.es/ server runs on the same machine. No idea how it impacted the measurements.