• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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