Cronjob and Moodle response

Cronjob and Moodle response

by Guillaume Seraglini -
Number of replies: 2

Hello everyone, I'm new to this forum, and I don't have a lot of knowledge about hardware.

My issue is, at night when the cronjob is running (apparently when is doing statistics) no one can access Moodle, when students wants to login, Moodle tries but it times out, and it's very frustrating for students. After when the stats are done everything goes back to normal, until the next night.

Does someone has or had that kind of issue? I don't know if it's due to multiple cronjob running at the same time, or too much load on the server. And I don't know how to fix that?

Our Moodle is running on OpenSUSE on a virtual server, with 3 GB of RAM, but the RAM never reach its limits even during this periode of big load.

Please can someone help with that?

Thanks a lot by advance for your help.

GK.

Average of ratings: -
In reply to Guillaume Seraglini

Re: Cronjob and Moodle response

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers

This is most likely a locking issue. The cron job is processing statistics, which means it executes very complex read queries on some of Moodle's tables (particularly the mdl_log table, I believe).

During this time, write operations to the same table may not be permitted. (This applies particularly if you use MySQL with the MyISAM engine, but i've seen the same with InnoDB as well.)

Unfortunately, almost every Moodle access results in a write operation to the mdl_log table. These operations are blocked until the lock is released, but likely this takes so long that the request times out meanwhile.

An immediate fix would be to turn the statistics feature off.

Average of ratings: Useful (1)
In reply to Henning Bostelmann

Re: Cronjob and Moodle response

by Guillaume Seraglini -

Thanks a lot for your answer.

I'm not sure I want to stop the statistics, because teachers love them. But if this is normal, because of tables locks, for now I can advise users that our Moodle will not be available during that period of time.

GK.