WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] WP Super Cache causes high "doing_wp_cron" load (9 posts)

  1. tigertech
    Member
    Posted 1 year ago #

    We've recently noticed that some of the busy WordPress sites we host are calling "POST /wp-cron.php?doing_wp_cron" several times a second. This causes high load.

    I believe we've traced this to a change in WP Super Cache 1.0. If someone was using a version of WP Super Cache from before version 1.0, and they then updated to version 1.0 or 1.1 without resaving the garbage collection settings, WP Super Cache can think that the garbage collection interval is 0.

    This happens because wp-cache-phase2.php contains this code in schedule_wp_gc() near the bottom:


    wp_schedule_single_event( time() + $cache_time_interval, 'wp_cache_gc' );

    That code relies on the global $cache_time_interval being set in the "wp-cache-config.php" file. But on sites that have been upgraded as I described, that variable isn't present. The code cited above treats $cache_time_interval as zero, making WP Super Cache constantly schedule the next garbage cleanup for the current time. The code fires again on the next HTTP request, and so on in an infinite loop.

    The code could protect against this problem (and others) with the addition of something like this before $cache_time_interval is used:


    if ( !isset( $cache_time_interval ) )
    $cache_time_interval = 3600;

    3600 is appropriate because that's the default it gets set to (based on $cache_max_time) anyway.

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. tigertech
    Member
    Posted 1 year ago #

    This issue didn't get a response from the WP Super Cache author donncha here, so I created a ticket for it on the plugins Trac (which I wasn't previously aware of and seems like the right place for such reports).

  3. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks tigertech, I'll fix that. I've been very busy and finding it hard to find time to check the support forum :(

  4. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

    And fixed, the dev version will update soon. Thanks!

  5. tigertech
    Member
    Posted 1 year ago #

    Thanks! The work you put into WP Super Cache is much appreciated, as always.

  6. drezac
    Member
    Posted 1 year ago #

    Our blog is lightening fast thanks to WP-Super Cache, but we're having hiccups, and now we're noticing this Cron issue.

    Our blog is doing this Cron thing right before it goes offline for about 30 seconds. It's always when we are accessing the dashboard, saving a post, or publishing a post, or clicking on a link in the dashboard.

    And we installed WP-Super Cache in like January, so I'm not convinced that this problem was totally fixed.

    I believe that these are related to other issues that we've had with WP-Super Cache causing "high load" as you call it- so much that is makes http://edreach.us unreachable for about 30secs to 1 minute.

    Is there a setting I should change in the backend that would help with this?
    Thanks!

    -Dan

  7. mbrsolution
    Member
    Posted 1 year ago #

    Hello @drezac, this support ticket is now resolved. If you create a new support ticket, it will help the developer and others provide more support.

    Kind regards

  8. tigertech
    Member
    Posted 1 year ago #

    drezac: This thread was about a particular problem where WP Super Cache could cause "wp-cron.php" script to run multiple times per second due to a specific bug. That bug is fixed.

    The wp-cron.php script also runs at other times, though, completely unrelated to WP Super Cache. It's used for all sorts of things by all sorts of plugins. Unless your specific problem is that "wp-cron.php" runs many times per second, your issue (that wp-cron.php causes your site to become unresponsive) is not related to this thread, and may not be related to WP Super Cache at all.

    As mbrsolution said, your best bet is to start a new thread. (But what people are going to tell you is to try disabling all your plugins, one by one, until the problem goes away, to find which plugin is the problem.)

  9. drezac
    Member
    Posted 1 year ago #

    This wp-cron issue didn't start until the WP-Super Cache plugin was installed.

    I created a new thread here, if you can walk us through troubleshooting.

    http://wordpress.org/support/topic/wp-super-cache-causing-high-doing_wp_cron-load?replies=1

    Thanks,

    -Dan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic