Submit all and finish takes too long time (1 minute or more)

Submit all and finish takes too long time (1 minute or more)

by Jaime Javier Arriola Suárez -
Number of replies: 4


Hello! I'm using Moodle 3.5.0 on Linux RedHat 6.5

The problem I have is that when the students finish an exam and send the confirmation that their answers have been stored it takes a long time, recently this has started to happen and before it did not happen.

I have verified the server from the terminal with the "top" command in order to identify if there is a process that causes high consumption of resources when sending the answers but nothing happens; On the other hand, the only track that I currently have is the Benchmark plugin, where the following message appears:

THE HARDDRIVE SEEMS TOO SLOW.

Check the harddrive and / or the temporary folder state

Change your harddrive or the temporary folder


I do not know how to solve this; any help in this topic will be very useful.


Many thanks in advance

Average of ratings: -
In reply to Jaime Javier Arriola Suárez

Re: Submit all and finish takes too long time (1 minute or more)

by Jaime Javier Arriola Suárez -

Here are some additional details:

I have just programmed cron execution to be done every minute.

Another detail that I forgot to mention is that the exam is 50 questions and the participants are allowed to take the exam again if they need it; This is because of a process within the company that I work.

I was thinking if this only happens in tests of "considerable length" ?, my questioning in this detail is because I have tested 10 questions and the shipping is almost immediate; On the other hand I have seen that when programming the cron every minute the message that the Benchmark gave me disappeared.

On the other hand, even if the exam is 50 questions before, this did not happen ...

In any case, I am waiting for your valuable comments.

Thanks & Best Regards!! smile

In reply to Jaime Javier Arriola Suárez

Re: Submit all and finish takes too long time (1 minute or more)

by Ken Task -
Picture of Particularly helpful Moodlers

Not sure about 'valuable comments' ... but more questions/guess?

Devil in details ... 3.5.0 or a point release ... 3.5.x?
DB server on same host (localhost) or dedicated DB or ?

"finish an exam and send the confirmation that their answers have been stored it takes a long time, recently this has started to happen"

"Finish exam and send" could be a heavy process ... number of questions to the quiz? (you've provided more info on that)
That's submission of data to the DB.  So when was the last time you checked on performance of the DB server? 

On RedHat 6.5, one could install MySQLTuner to get a look see if DB server config
needs tweaking.

Top will show php, apache processes and if DB server local host, mysqld.
Using any SWAP space?  And if server is using SWAP space what is using
it ... mysqld?

Top with 'f' 'n' will order the processes so you can see what is using most memory.
Like:

Mem:   8053456k total,  7024804k used,  1028652k free,   317732k buffers
Swap:        0k total,        0k used,        0k free,  4305980k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  SWAP COMMAND     
 1996 mysql     20   0 3361m 1.7g 5924 S  0.3 22.5 135:20.21    0 mysqld       
  706 apache    20   0  648m  93m  77m S  0.0  1.2   1:52.21    0 httpd

Server example above a CentOS 6.10 running apache as a mod and with exception of
burstable php processes the localhost DB server is consistently using 22.5 of mem.

'spirit of sharing', Ken

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

Re: Submit all and finish takes too long time (1 minute or more)

by Jaime Javier Arriola Suárez -

Hi Ken, Thanks for your commment.

By the way i have view on Site Administration-->Notifications and I get: Moodle 3.5 (Build: 20180517)

On the other hand DB is on the same server as Moodle

Likewise I will verify the performance of the database although I do not know very well what I should look for or what actions to execute on it

In reply to Jaime Javier Arriola Suárez

Re: Submit all and finish takes too long time (1 minute or more)

by Ken Task -
Picture of Particularly helpful Moodlers

When you run MySQLTuner it will look at config/stats DB keeps, show you values, etc. and at the bottom it's recommendations for settings.   You might not want to do all recommendations ... and I can't tell you what those would be for your server.

From what you have described in quizzes, look for the following:

[--] Physical Memory
[--] Max MySQL memory

[--] Other process memory

[OK] Maximum reached memory usage:
[OK] Maximum possible memory usage:
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries:
[OK] Highest usage of available connections: - this one might tweaking for sure ... evidence ... web server logs reporting 'Server has gone away'.

The section on -------- InnoDB Metrics

[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: ... buffer pool needs to be larger than data size ... just a little.

Also check php settings ... which you can see in Server PHPInfo ... max times ... script to run, memory to consume, etc.   anything that might/possibly affect the issue you are having with submission of Quiz.   Ok, you don't know what you don' t know, so don't go nuts changing 20 parameters without doing some research.   Matter of fact, best to change only those you can remember you changed (write it down).   One could tweak server into other problems .. not resolution of a single problem.

Clear as mud, huh?    Sorry ... no Vulcan Mind Meld possible!

'spirit of sharing', Ken