• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Issue cron is queuing tasks and accumulating them on hold

Daniel Pereyra

New Pleskian
I have setup a cron to run every minute, seeing the cron log, is running, so that is ok.
Code:
* * * * * /opt/plesk/php/7.1/bin/php -f '/var/www/vhosts/domain***/adm/test.php'

The cron I have setup is a simple php file that logs the time this file is executed.
PHP:
date_default_timezone_set('America/New_York');
$date = date("Y-m-d H:i:s");
$file = __FILE__;
$level = "warning";
$message = "[{$date}] [{$file}] [{$level}] execution".PHP_EOL;
error_log($message, 3, '/var/www/vhosts/domain***/logs/domain***/my-errors.log');

The issue is that this task is for some reason, randomly put to queue, so for example I have this task repeated 5 times, 4 times, or 3 times, instead of one per minute.

This are the cron logs
Code:
Oct 1 10:01:01 localhost CROND[2315]
Oct 1 10:02:01 localhost CROND[2388]
Oct 1 10:03:01 localhost CROND[2440]
Oct 1 10:04:01 localhost CROND[2493]
Oct 1 10:05:01 localhost CROND[2566]
Oct 1 10:06:01 localhost CROND[2627]
Oct 1 10:07:01 localhost CROND[2743]

This are the task logs
Code:
Monday, 01-Oct-2018 10:00:01 EDT
Monday, 01-Oct-2018 10:05:42 EDT
Monday, 01-Oct-2018 10:05:42 EDT
Monday, 01-Oct-2018 10:05:42 EDT
Monday, 01-Oct-2018 10:05:42 EDT
Monday, 01-Oct-2018 10:05:42 EDT
Monday, 01-Oct-2018 10:06:01 EDT
Monday, 01-Oct-2018 10:07:01 EDT

Someone else told me to create a bash script and test the same thing with cron:

Script:
Code:
#!/bin/bash
echo $(date);
exit 0

Crontab:
Code:
* * * * * /var/www/vhosts/domain***/test.sh >> /var/www/vhosts/winnersmartialarts.com/logs/domain***/date.log

But the results surprised me, they are great:
Code:
Tue Oct 2 05:08:01 EDT 2018
Tue Oct 2 05:09:01 EDT 2018
Tue Oct 2 05:10:01 EDT 2018
Tue Oct 2 05:11:01 EDT 2018
Tue Oct 2 05:12:01 EDT 2018
Tue Oct 2 05:13:01 EDT 2018
Tue Oct 2 05:14:01 EDT 2018
Tue Oct 2 05:15:01 EDT 2018
Tue Oct 2 05:16:01 EDT 2018
Tue Oct 2 05:17:01 EDT 2018
Tue Oct 2 05:18:01 EDT 2018
Tue Oct 2 05:19:02 EDT 2018
Tue Oct 2 05:20:01 EDT 2018
Tue Oct 2 05:21:01 EDT 2018
Tue Oct 2 05:22:01 EDT 2018
Tue Oct 2 05:23:01 EDT 2018
Tue Oct 2 05:24:01 EDT 2018
Tue Oct 2 05:25:01 EDT 2018
Tue Oct 2 05:26:01 EDT 2018
Tue Oct 2 05:27:01 EDT 2018
Tue Oct 2 05:28:01 EDT 2018
Tue Oct 2 05:29:01 EDT 2018
Tue Oct 2 05:30:01 EDT 2018
Tue Oct 2 05:31:01 EDT 2018
Tue Oct 2 05:32:01 EDT 2018
Tue Oct 2 05:33:01 EDT 2018
Tue Oct 2 05:34:01 EDT 2018
Tue Oct 2 05:35:01 EDT 2018
Tue Oct 2 05:36:02 EDT 2018
Tue Oct 2 05:37:01 EDT 2018
Tue Oct 2 05:38:01 EDT 2018

So what do you think this is? An Apache issue? PHP issue?
Any help would be appreciated. Thank you.
 
Back
Top