嗨,有人知道为什么crontab无法按时执行吗?它延迟了至少10秒。它是EC2实例。
shell>uname -a
shell>Linux srv-796-db1 3.14.20-20.44.amzn1.x86_64 #1 SMP Mon Oct 6 22:52:46 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux #Server Info
awk '{split($3,a,":"); if (a[3] > 10) {print;}}' /var/log/cron | head -50
Jan 11 22:30:13 srv-796-db1 CROND[12017]: (root) CMD (sleep 20; /usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12019]: (root) CMD (sleep 10; /usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12021]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12024]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12026]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12030]: (root) CMD (sleep 40; /usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12032]: (root) CMD (sleep 30; /usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12034]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12037]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12041]: (root) CMD (sleep 20; /usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:13 srv-796-db1 CROND[12045]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:14 srv-796-db1 CROND[12048]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:30:14 srv-796-db1 CROND[12052]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Jan 11 22:40:11 srv-796-db1 CROND[18845]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:40:11 srv-796-db1 CROND[18848]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:40:11 srv-796-db1 CROND[18849]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:40:11 srv-796-db1 CROND[18854]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Jan 11 22:40:11 srv-796-db1 CROND[18855]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
Jan 11 22:40:11 srv-796-db1 CROND[18858]: (root) CMD (/usr/bin/php -f #different php script here >/dev/null 2>&1)
任何想法???
答案 0 :(得分:0)
只是想关闭这个问题.. Cronjob并不保证任务准确按时运行。 但是,在开始任务之前,它将检查上一个任务状态。如果上一个任务没有完成,它将延迟该过程.. 另一方面,许多因素......例如“打开文件限制”,“os时间”......