Support » Fixing WordPress » WP-Cron out of control

  • Would someone be able to explain why wp-cron is taking up so many resources?

    From /var/logs/httpd/error-log:

    [Thu Apr 22 01:41:15 2010] [notice] mod_fcgid: call /var/www/vhosts/ with wrapper /usr/bin/php-cgi
    [Thu Apr 22 01:41:15 2010] [notice] mod_fcgid: server /var/www/vhosts/ started
    ...The previous line shows up 8661 times...

    Whats in Cron?

    Apr 22, 2010 @ 18:25 (1271960731)	 Twice Daily	wp_version_check
    Apr 22, 2010 @ 18:25 (1271960731)	 Twice Daily	wp_update_plugins
    Apr 22, 2010 @ 18:25 (1271960731)	 Twice Daily	wp_update_themes
    Apr 23, 2010 @ 12:21 (1272025294)	 Once Daily	wp_scheduled_delete

    Running CentoOS 5/plesk 9.3/php as FastCGI/suExec

    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • found the following in the error log

    [Thu Apr 22 22:08:34 2010] [warn] mod_fcgid: stderr: WordPress database error Table 'iwKFRD4UBiNwordp.rpzf_commentmeta' doesn't exist for query SELECT comment_id FROM rpzf_commentmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '1269392914' made by do_action_ref_array, call_user_func_array, wp_scheduled_delete

    this could be causing wp-cron to loop over and over.

    running /wp-admin/upgrade.php says the DB is already up to date

    sorry but I didnt mention I am running WP 2.9.2

    any advice?

    i guess the next step is find out the sql script to manually add the commentmeta table and see if the problem goes away. anyone can help with this?


    thanks in advance.

    make sure to substitute “Prefix_” for your WP table Prefix, if you use one. Collation and DB Engine should be pretty similar to the ones below across the board.

    /*!40101 SET NAMES utf8 */;
    CREATE TABLE IF NOT EXISTS <code>Prefix_commentmeta</code> (
      <code>meta_id</code> bigint(20) unsigned NOT NULL auto_increment,
      <code>comment_id</code> bigint(20) unsigned NOT NULL default '0',
      <code>meta_key</code> varchar(255) default NULL,
      <code>meta_value</code> longtext,
      PRIMARY KEY  (<code>meta_id</code>),
      KEY <code>comment_id</code> (<code>comment_id</code>),
      KEY <code>meta_key</code> (<code>meta_key</code>)

    My host recently put in an .htaccess file (where I can’t see it) that is blocking gets to wp-cron.php. They said I am using way more CPU than I should, and that my script was “calling itself” over and over (I had to explain it’s not “my script”). Apparently wp-cron was going into a hard loop or something similar and really causing havoc.

    I checked, and that table is not missing from my install, so I doubt it’s the problem.

    Can wp-cron be modified to not fire on every page load, but perhaps just on certain pages or at certain times?

    I hope I’m wrong, but I cannot find any indication that WordPress developers care about this widespread problem of wp-cron.php overload. Perhaps they’re on powerful servers, so it doesn’t bother them.

    I’m thinking of renaming to wp-cron0.php and then calling it occasionally with a cron job. I don’t know yet what the appropriate “occasionally” would be.

    My coworker just found an instance yesterday of one of our client sites with a wp-cron looping problem. It was affecting the server drastically. The trigger was a missing resource – in this case it was just an image – so he put in a file with the matching name, and the looping stopped.

    I hope LaneLester’s not right about WP developers not caring. Do WordPress engineers even know about these problems with wp-cron? I’m not a programmer, but shouldn’t wp-cron handle these missing tables and/or files more gracefully? How does a mere mortal contact the right people to ask them to please look at this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WP-Cron out of control’ is closed to new replies.