• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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