WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Super Cache] wp super cache slows down posting (15 posts)

  1. ericr23
    Member
    Posted 5 years ago #

    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?

  2. Donncha O Caoimh
    Member
    Posted 5 years ago #

    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?)

  3. ericr23
    Member
    Posted 5 years ago #

    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?

  4. Donncha O Caoimh
    Member
    Posted 5 years ago #

    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.

  5. ericr23
    Member
    Posted 5 years ago #

    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
    WP-Cache
        * 1011 cached pages
        * 1007 expired pages
    WP-Super-Cache
        * 2 cached pages
        * 515 expired pages.
  6. Donncha O Caoimh
    Member
    Posted 5 years ago #

    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.

  7. ericr23
    Member
    Posted 5 years ago #

    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.

  8. Donncha O Caoimh
    Member
    Posted 5 years ago #

    What operating system is your site running on?

    Are you getting any out of memory errors?

  9. ericr23
    Member
    Posted 5 years ago #

    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.

  10. ericr23
    Member
    Posted 5 years ago #

    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.

  11. 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
           wp_mail();
  12. ericr23
    Member
    Posted 5 years ago #

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

  13. ericr23
    Member
    Posted 5 years ago #

    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?

  14. 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.

  15. 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?

Topic Closed

This topic has been closed to new replies.

About this Topic