Slow Moodle and Error message: 504 Gateway Timeout

Re: Slow Moodle and Error message: 504 Gateway Timeout

by Ken Task -
Number of replies: 1
Picture of Particularly helpful Moodlers

So 2 Moodle sites (A&B) which share the same FQDN (like a round robin load balancer) and one dedicated DB server on a separate VM.

What of moodledata?   Does MoodleA have a moodledata and does MoodleB have a moodledata of it's own?

'know of existence' ... well, if reporting issues and poster doesn't provide true technical info about setup - the real setup (all of it) - then those who are trying to help are/could be sent off into rabbit chases which in turn if OP is asked to perform something could lead to all going down a rabbit hole!

Don't have time to play 'Elmer Fudd'. :|

'SoS', Ken



Average of ratings: Useful (1)
In reply to Ken Task

[Solved]: Slow Moodle and Error message: 504 Gateway Timeout

by Dave Weninger -
My boss had split the web server and DB. The error message "504 Gateway Timeout" no longer appears. The problem should be partially solved. 

It is believed that the root cause of the problem is due to the successively uploading of image files while the upload of previous one had not yet completed. This leads to concurrent http POST request, causing the session lock issue https://moodle.org/mod/forum/discuss.php?d=419645, It is seems that data writing into the database is not fast enough. From Giuseppe Mandara's suggested solution is to switch to use SSD. It is not easy for us to switch to SSD at this moment. Therefore, we will not require students to upload photos of answer scripts in the future.

Another part of the issue is how to maximize the number of concurrent users to be supported. As the apache2buddy shows the apache process size is as large as 317MB, the actual MaxRequestWorkers  value = database size/apache process size =about 120. Merely raising the MaxRequestWorkers value to 1024 can only raise the ceiling, would not help. The solution is to reduce the apache process size or adding more physical memory.