• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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