Cron task making httpd irresponsive?

Cron task making httpd irresponsive?

by Luca Bösch -
Number of replies: 5
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi


Has anyone of you experienced such things yet?
We're on Moodle 3.2.1, PHP 7


It seems like running \\mod_forum\\task\\cron_task is causing Moodle sometimes to lock. We're talking 5 minutes sometimes 10.

Httpd just doesn't respond to requests. Moodle 'freezes'.

What could that be? I'm starting to look into mod/forum/classes/task/cron_task.php now.

Average of ratings: -
In reply to Luca Bösch

Re: Cron task making httpd irresponsive?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It's important (kind of obviously) to track down what is going on when Moodle has 'stopped'. 

Firstly the 'top' command can tell you a lot. Is some process using 100% CPU? Lots of memory? Is it using swap memory?

What does 'show processlist' in MySQL tell you? Is the database doing something. If it is, set up 'slow query logging' and find out what. 

Failing that, consider using 'strace' to figure out what the PHP process is doing (assuming you can identify it). This should turn up problems with file storage etc.. A good tutorial for this stuff is here - https://derickrethans.nl/what-is-php-doing.html

In reply to Howard Miller

Re: Cron task making httpd irresponsive?

by Luca Bösch -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

By excluding (we've set up cron running less frequently to investigate whether irresponsiveness happens nevertheless cron not running) it's quite obvious the outages have nothing to do with cron.

But we see a number of non closing writing async connections. Apache log do not really help in saying us what those requests are.

Any thoughts?

In reply to Luca Bösch

Re: Cron task making httpd irresponsive?

by Luca Bösch -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

My system administrator tell me it had to do with KeepAlive.

After setting KeepAlive Off everything works out smoothly.

In reply to Luca Bösch

Re: Cron task making httpd irresponsive?

by Paul Verrall -

Keepalive isn't necessarily a bad thing as it has advantages, especially for busy sites. Do consider just reducing your keep-live timeouts to see if you can eliminate the problem and still benefit from this httpd feature.

Average of ratings: Useful (1)