disable wp-cron.php

trace wp-super-cache的时候,发现后台有很多wp-cron.php的调用,每一次访问页面都会调用。

01:32:22 /wp-cron.php?doing_wp_cron=1341019942.6320919990539550781250 In WP Cache Phase 2
01:32:22 /wp-cron.php?doing_wp_cron=1341019942.6320919990539550781250 Setting up WordPress actions
01:32:22 /wp-cron.php?doing_wp_cron=1341019942.6320919990539550781250 Not caching POST request.
01:32:22 /wp-cron.php?doing_wp_cron=1341019942.6320919990539550781250 Cache garbage collection.
01:32:22 /wp-cron.php?doing_wp_cron=1341019942.6320919990539550781250 Cleaning expired cache files in /****/public_html/wp-content/cache/
01:32:22 /wp-cron.php?doing_wp_cron=1341019942.6320919990539550781250 Doing GC on supercache dir: /****/public_html/wp-content/cache/supercache
01:32:22 /wp-cron.php?doing_wp_cron=1341019942.6320919990539550781250 gc: could not delete /****/public_html/wp-content/cache/supercache/6658.net/2012/01 as it’s not empty: 30

google之,发现该进程会占用很多系统资源。用google到的如下方法disable
在wp-config.php中添加

define(‘DISABLE_WP_CRON’, true);

然后在系统的crontab中添加

0,30 * * * * php -q /path_to_your_website/public_html/wp-cron.php

参考文档
http://blog.mellowhost.com/reducing-cpu-usage-for-wordpress-users.html

disable wp-cron.php》上有1条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注