[Plugin: WP Super Cache] scaling issues (6 posts)

  1. bobbyh
    Posted 7 years ago #

    I'd like to start by saying that I'm a long-time wp-cache user/fan, and I've been amazed by how awesome wp-super-cache is! Thanks donncha for your rocking supercache code! :-)

    I think I'm running into a scaling issue with the wp-cache part of wp-super-cache, and I'm wondering if anybody else is seeing the same issue? Our WordPress blog's wp-cache does a lot of caching. The issue is that /wp-content/cache/ has loads of files in it. For instance, tonight at 9:30 PM, there are 1,228 wp-cache files in /wp-content/cache/. During peak, this number is much higher.

    I think this causes Apache to slow down, because Apache needs to scan the folder to see if there's an existing wp-cache file to serve to a given cookied user (and then serve that cached file, or generate a new one). This means that each pageview requires a scan of a directory with at least a thousand files.

    This is just a hypothesis, but we're running another site on a similar server, and it's *so* much faster. I think the big difference is this directory-scan issue. (The new site has many many fewer wp-cache files.)

    I wanted to post here for two reasons:

    First, is anybody else seeing this sort of issue on a high-traffic blog?

    Second, are there any workarounds to this issue? For instance, would it be possible to put wp-cache cache files into subdirectories, much as supercache does? For instance, the supercached cache file for a random blog page is located in this nested subdirectory: /wp-content/cache/supercache/www.sitename.com/2008/12/08/slug-slug/index.html. Using subdirectories would seem to eliminate the directory-scan issue. Would taking the supercache-nested-folder approach be relevant to solving this wpcache-directory-scan issue?



  2. Donncha O Caoimh
    Posted 7 years ago #

    That's a known issue, especially with WPMU sites. How often is your garbage collection set for?

  3. engelsol
    Posted 7 years ago #

    same problem as above....

    and adding to that why there are so many generated wp-super-cache files at /tmp directory...

    the garbage collection delete wp-super-cache files in the /tmp dir also?

  4. Donncha O Caoimh
    Posted 7 years ago #

    engelsol - see http://wordpress.org/support/topic/218152?replies=4#post-918619

    GC will delete files in where ever you've set as the cache dir.

  5. bobbyh
    Posted 7 years ago #

    My garbage collection was set high, that was definitely an issue. I lowered it, and that helped. But to avoid the problem in the future (as the site scales), I also switched to this variant of super cache that uses eaccelerator as a backend: http://murmatrons.armadillo.homeip.net/features/experimental-eaccelerator-wp-super-cache. donncha, it'd be awesome to integrate that into the plugin itself. :-)

  6. nast0
    Posted 7 years ago #

    I'm interested in this thread as i have an 11,000 post WordPress site, which has increasing traffic... and we use wp-cache (super mode off). Currently I have around 2,000 cached files, expire set to 3 days, and 1,500 uniques a day.

    If the site were to receive 5,000 uniques a day, I may end up with 6,000+ cached pages in the cache dir.

    Is this likely to push Apache? Server load isn't an issue at the moment (yesterday 5-min ave 0.8)... but will it be in future with these settings?


Topic Closed

This topic has been closed to new replies.

About this Topic