cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple instances of the cron running at the same time

Multiple instances of the cron running at the same time

Since our upgrade to 2.2.1 the number of crons running for the webshop is getting higher and higher. It looks like a new cron instance is started while the old one is not finished yet;

 

USER PID %CPU %MEM VSZ RSS TTY Ss 18:56 0:05 /opt/plesk/php/7.0/bin/php -f httpdocs/bin/magento -- cron:run
USER PID %CPU %MEM VSZ RSS TTY Ss 18:57 0:04 /opt/plesk/php/7.0/bin/php -f httpdocs/bin/magento -- cron:run
USER PID %CPU %MEM VSZ RSS TTY Rs 18:58 0:03 /opt/plesk/php/7.0/bin/php -f httpdocs/bin/magento -- cron:run

I think the new instance should not start when there's already an instance running? Does anyone have a clue what's wrong or how to fix this?

4 REPLIES 4

Re: Multiple instances of the cron running at the same time

Hi @wyrix,

 

Can you check if you have, currently, the configurations as the documentation recommends?

 

http://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-cron.html

Re: Multiple instances of the cron running at the same time

Hi Damian,

 

Yes, they are setup as recommended except the fact that we log everything in the Plesk logs instead of custom log files;

httpdocs/bin/magento cron:run	 * * * * *
httpdocs/update/cron.php	 * * * * *
httpdocs/bin/magento setup:cron:run setup:cron:run	 * * * * *

 

Re: Multiple instances of the cron running at the same time

I've found out that it looks like the same issue as mentioned here;

https://github.com/magento/magento2/issues/11002

 

I think running this query fixed it for me, but I will monitor it for a while to see if it's realy fixed now.

delete from cron_schedule where scheduled_at < date_sub(now(), interval 1 hour);

Re: Multiple instances of the cron running at the same time

Hi @wyrix  did running the query fixed the issue? I am having same issues.