Hardware and performance

Cron task making httpd irresponsive?

 
Picture of Luca Bösch
Cron task making httpd irresponsive?
Group Core developers

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: -
Picture of Howard Miller
Re: Cron task making httpd irresponsive?
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup 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

 
Average of ratings: -
Picture of Luca Bösch
Re: Cron task making httpd irresponsive?
Group Core developers

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?

 
Average of ratings: -
Picture of Luca Bösch
Re: Cron task making httpd irresponsive?
Group Core developers

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

After setting KeepAlive Off everything works out smoothly.

 
Average of ratings: -
Picture of Howard Miller
Re: Cron task making httpd irresponsive?
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

Result!  Good to hear. 

 
Average of ratings: -
Picture of Paul Verrall
Re: Cron task making httpd irresponsive?
Group Core developersGroup Documentation writers

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)