WordPress.org

Ready to get started?Download WordPress

Forums

WP-Cron out of control (7 posts)

  1. Eddie - Digital Marketing Consultant
    Member
    Posted 3 years ago #

    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/mydomain.com/httpdocs/wp-cron.php with wrapper /usr/bin/php-cgi
    [Thu Apr 22 01:41:15 2010] [notice] mod_fcgid: server /var/www/vhosts/mydomain.com/httpdocs/wp-cron.php(17999) 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.

  2. Eddie - Digital Marketing Consultant
    Member
    Posted 3 years ago #

    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?

  3. Eddie - Digital Marketing Consultant
    Member
    Posted 3 years ago #

    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?

    hello!?

    thanks in advance.

  4. Eddie - Digital Marketing Consultant
    Member
    Posted 3 years ago #

    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.

    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!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>)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  5. WWDay3
    Member
    Posted 3 years ago #

    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?

  6. LaneLester
    Member
    Posted 3 years ago #

    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.

  7. jessibird
    Member
    Posted 3 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic