Support » Plugins and Hacks » [Plugin: WP Super Cache] wp super cache slows down posting

  • The wp-super-cache plugin works fine on 3 installations (one of them 2.7RC1, the others 2.6.5, plugin v.0.8.6 on all), except that in one of the 2.6.5 sites (the busiest and largest), publishing a post seems to hang unless wp-super-cache is turned off. Editing an already published post goes better, but often (always?) results in a blank page.

    What might be the problem here?

Viewing 14 replies - 1 through 14 (of 14 total)
  • You probably have loads of cached files and the plugin is trying to clear the affected ones. How often is your garbage collection running? Do you see it deleting files? (ie. are there files in your cache folder older than the garbage collection time?)

    As always, thank you for the prompt reply!

    The Expiry Time and Garbage Collection settings are what I believe are the defaults: 3600 seconds and once every hour, respectively.

    I will try changing the garbage collection to every 6 hours.

    Should I also correspondingly increase the expiry time?

    No, unfortunately you probably need to run the GC more than once an hour.
    Look in wp-content/wp-cache-config.php for the line:
    $wp_cache_gc = 3600;

    and change 3600 to 600 or whatever number of seconds you like. If the line isn’t there, add it. Set the cache expiry to a few seconds less than whatever number you choose.

    Setting $wp_cache_gc=600 and the expire time to 590 appears to have helped.

    But expired super-cache files don’t seem to be cleaned up:

    Cache Contents
        * 1011 cached pages
        * 1007 expired pages
        * 2 cached pages
        * 515 expired pages.

    Weird, I guess your host is not executing the WordPress cron job. Add a wp_mail() to wp_cache_gc_cron() in wp-cache-phase2.php to send yourself a mail when it runs.

    I added wp_mail() to wp_cache_gc_cron() last night as suggested and had plenty of e-mails when I checked in this morning.

    I’ve noticed that if I haven’t checked it for a while, the options page for the plugin takes a long time to load and often hangs after writing the page down to the Cache Contents (i.e., the page from Cache Contents on does not appear). The only remedy is to delete the cache using the dashboard link. That then hangs, but after canceling the page load and reloading the plugin options page, the Cache Contents show that it was successful.

    The long loading time occurs with my less-busy installations as well (especially since I check them less frequently). And I notice that manually deleting expired files doesn’t touch the super-cache expired files and also deletes the cache files, both legacy and super.

    What operating system is your site running on?

    Are you getting any out of memory errors?

    The site is VPS-hosted on Linux, with Apache 2.2.9, MySQL 5.0.51a, and PHP 5.2.6.

    No out-of-memory errors that I’m aware of. The PHP memory limit is 32M. The system memory is 1G.

    Good news! It turns out that the server’s RAID was suffering with a bad disk. It’s been repaired, and everything now appears to be working as expected. I’ll report back if anything is still amiss.

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    Add a wp_mail() to wp_cache_gc_cron() in wp-cache-phase2.php to send yourself a mail when it runs.

    Where would one add that in the file and … er what params do you put in? I’m curious to know.

    Is is just

    if( !wp_cache_phase2_clean_expired($file_prefix ) )
           update_option( 'wpsupercache_gc_time', time() - ( $wp_cache_gc - 600 )); // if GC failed then run it again in 10 minutes

    Yes, that’s what I did. Be sure to add the required parameters:
    wp_mail($to, $subject, $message);

    Update: The disk problem did slow things down a bit, but the garbage collection is still not occurring automatically.

    Is there a way to delete the expired and clear the cache via system cronjob?

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    I’m seeing the same thing since re-installing, which is mindboggling. I seem to recall this working before. :/

    My error log is blissfully 100% empty, no mutex_lock issues, everything is saving to /tmp as designed.

    I set up wpsc’s cron to email me every hour though I’m not seeing any emails.

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    I’m starting to think my htaccess is wrong.

    This is in my .htaccess BUT that’s not where my cache is located!

    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]

    I moved it to /tmp/ – Should I change this as well?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: WP Super Cache] wp super cache slows down posting’ is closed to new replies.