WordPress.org

Ready to get started?Download WordPress

Forums

WP-Cache & WP-Super Cache Increasing CPU Usage (48 posts)

  1. boogah
    Member
    Posted 6 years ago #

    I'm trying to help somebody fine tune their WordPress install on a VPS and suggested that they try either WP-Cache or WP-Super-Cache to lessen the load that the blog creates on the server. Upon trying this, both plugins actually seem to drive the load up considerably and crash their VPS. I'm sure it's a plugin conflict, but I was curious to know if anyone else had seen this behavior - and if so, what they did to remedy it.

    I appreciate any guidance you can provide and will be glad to give anyone more info if necessary.

  2. theapparatus
    Member
    Posted 6 years ago #

    Which version of the supercache are you using? It seems like it's getting upgraded every day so you may want to check on it.

    To be honest, at the beginning it will raise load levels as those static pages need to be generated first. if this is a new blog or one with low traffic, I'd just leave it alone.

  3. boogah
    Member
    Posted 6 years ago #

    So the guy I'm helping out has filled me in on the info you've asked about. It would appear that 0.5.1 is the version he is running - and he's been upgrading since 0.1 trying to make the issue go away.

    See, the problem is that I'm on a similar configuration (VPS, WordPress 2.3.1, WP-Super-Cache 0.5.1) and I'm not seeing what this guy is. The second he turns on WP-Super-Cache and WP-Cache, his usage skyrockets to the point of being absurd. I've seen little spikes when I enable a caching plugin, but not like this. From what I know, that spike is when he attempts to enable a caching mechanism - and since he's not set up for that sort of usage, it crashes his server and brings down his site.

    He's sent along a list of plugins he's had enabled, and I'm going to go ahead and paste that below:

    The following plugins are now enabled on my site:

    - Adsense-Deluxe 0.8
    - Akismet 2.0.2
    - Browser Sniff 1.10
    - Chunk Urls for WordPress 2.0
    - Flexible upload 1.9
    - Less 1.1
    - Math Comment Spam Protection 2.1
    - Official Comments 1.1
    - Subscribe To Comments 2.1.1
    - WP-PageNavi 2.20

    And these ones are also installed but I've disabled them for the testing we did and have decided to keep them that way:

    - Favicon Manager 0.1
    - FeedBurner FeedSmith 2.3
    - Google XML Sitemaps 3.0.2
    - Maintenance Mode 3.2
    - Most Commented 1.4
    - Recent Comments 1.18
    - Recent Posts 1.07
    - Related Posts 2.04
    - WP-Polls 2.21
    - WP-Polls Widget 2.21
    - WP Super Cache 0.5.1

    Like I said, any ideas y'all might have about this would be awesome.

  4. Rafael Fischmann
    Member
    Posted 6 years ago #

    boogah, if you let me, I'd like to participate on the discussion as well. I'm the guy he's talking about. Just a quick comment about the posted graph, as it's not showing exactly what happens and it's far from the REAL problem. What really spikes then enabling both WP-Super Cache or WP-Cache is the memory usage (all the way up, really, off the charts), not the CPU. The CPU actually goes down. Sometimes it does spike as the graph shows, but I don't think that's the core of the problem we're talking about.

  5. Donncha O Caoimh
    Member
    Posted 6 years ago #

    rfischmann - is your VPS hosted on a NFS server? If the filesystem is mounted off a remote server then doing excessive writes could cause what you're seeing.

  6. boogah
    Member
    Posted 6 years ago #

    @donncha: The server does utilize NFS based storage, but as I said I'm in the exact same environment and I'm not seeing the issues that rfischmann is. In fact, Super Cache works awesome on my VPS.

  7. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Boogah - what file locking mechanism are you using? flock or sem_get? Is rfischmann using the same?

  8. boogah
    Member
    Posted 6 years ago #

    @donncha: I've checked with our admin team and according to them we should be using flock across all of our servers.

  9. Donncha O Caoimh
    Member
    Posted 6 years ago #

    boogah - That could be a problem. Flock doesn't work too well with NFS, even the PHP manual page for flock() says so:
    http://ie.php.net/flock

    Can you try the default semaphone locking?

  10. emremer
    Member
    Posted 6 years ago #

    I have a CPU problems with my wp 2.3.1 sites on Bluehost.com.
    I have not more visitors, i did not install other plugins, i did not create new/addon site.
    Changes are only
    2.2.2 to> 2.3.1
    wp-cache to> wp-super-cache
    I dont know flock or other techichal details :(
    I hope and wait this plugin will be better & easy.

  11. Donncha O Caoimh
    Member
    Posted 6 years ago #

    I don't suppose you can login to your account and run "top" from the command line?

    Make sure you upgraded your plugins because there were many changes between those versions of WordPress.

  12. boogah
    Member
    Posted 6 years ago #

    @donncha: So, correction. It took me a little time to get an audience with them, but the person in charge of the NFS setup here corrected me to let me know that we actually use semaphone locking by default on all of our servers here as flock isn't that stellar with PHP.

    Apologies for going down the wrong rabbit hole. I'll let the person that gave me that info know that it was wrong. So, where do we go from here?

  13. Donncha O Caoimh
    Member
    Posted 6 years ago #

    I'm not sure tbh. Trying to use the plugin on an NFS mounted directory is bad in the first place, but there could be minor differences between where your VPS is hosted and the other one that's causing problems. Maybe one machine is physically closer to the NFS server. I don't know.

    Bottom line - trying to cache to an NFS directory is bad for performance.

  14. boogah
    Member
    Posted 6 years ago #

    @donncha: See, that's the weird thing. Our VPS setups are *exactly* the same. I know this because I work for the hosting company (DreamHost) where he is having these problems and I can see the way our machines are configured.

    Super Cache is an awesome extension of the now abandoned WP-Cache - and I recommend it to most of our customers running into issues. This is the only time I've actually seen it spike this way instead of plugging along as expected, so it's sort of a head scratcher.

    So if the guy who coded/built upon the original plugin doesn't know, I'm not quite sure what I'm going to tell the customer - but that's on my head. ;)

    I'll keep this thread marked as unresolved and follow it to see if anyone else might have any suggestions. Thanks for your help tho.

  15. Rafael Fischmann
    Member
    Posted 6 years ago #

    Dear donncha,

    It seems like nobody else has any suggestions and boogah also can't help me with this problem.

    A few days ago I decided to completely remove WP-Super Cache from my server, downloaded the latest version and tried it again.

    Same thing. A few minutes after enabling it (I mean 5 minutes, more or less), my Private Server at DreamHost spikes, free memory goes to 0MB, I start to see 500 Internal Server Error messages and CPU usage spikes as well.

    I don't know what to do and I really wanted to be able to user your plugin; my site is using too much resources and I can't afford this PS at DH for too long.

    I'm willing to pay you some money (please bear with me) for you to look at my problem, I'd give you FTP and Admin access to it so you could take a look. Please tell me if that's possible and when can you do it. I'm desperate!

    Thanks a lot in advance.

  16. storyfirst
    Member
    Posted 6 years ago #

    I'm having the same CPU spiking problems, getting shut down by my hosting provider. This started about three days ago. At that point I turned supercache on for the first time, but it hasn't helped or hindered -- the CPU spikes continue (as seen in the cpulog excerpt below -- always having to do with index.php).

    [20/Jan/2008:00:00:00 -0500] 66.249.65.166 rosinalippi.com /home/rosina/public_html/rosinalippi-com/weblog/index.php 0.677897

    I've turned off most of my plugins and done everything else I could think of, read through all of the cpu discussions here on the forum.

    It seems nobody has an answer. Any suggestions on what to try next?

  17. crazlunatic
    Member
    Posted 6 years ago #

    I'm having problems too please help us all!

  18. Donncha O Caoimh
    Member
    Posted 6 years ago #

    How much memory does your account have?

  19. igneous
    Member
    Posted 6 years ago #

    Same happens for me on my dreamhost vps. I really want to use a cache plugin, but I'm not able to because my #'s go way up. Plus I get a ton of comments on my site, and have about 6800 posts, so I'm not sure if that's a realistic goal.

  20. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Try the Lockdown feature - even if you get lots of comments they won't appear until you explicitly clear the cache. That should help a lot but it may piss off your users.
    Otherwise, get a bigger server. Sounds like you have quite a big blog!

  21. JesseHeap
    Member
    Posted 6 years ago #

    Having same exact issue as rfischmann.

    Was recently moved to private Dreamhost server and within a few minutes experienced a spike in memory usage to the point where free memory went to 0 and the site became inaccessible.

    I determined WP-cache was causing the memory issue because after disabling the plugin memory usage quickly goes back down to appropriate levels.

    Dreamhost has recommended trying Super-cache, but I wouldn't be surprised if it causes the same issue...

  22. palPalani
    Member
    Posted 6 years ago #

    i have same problem with WP2.5, mine is shared hosting, my provider have suspended my account 3 times and finally they said there is no way to continue with this shared hosting, now I'm VPS account, but still I'm getting this issue again.

  23. Posterd
    Member
    Posted 6 years ago #

    If Gzip compression is enabled - it needs to use more CPU.

    And I have a proposal for plugin. Is to set max CPU load value for blog (for example 5%). So if the CPU load is higher WPCache gives only cached pages and doesn't allows to generate new pages (gives some predefined screen "Sorry, the server is gone").

    I had a problem with my hosting too. So wrote a little script that checks CPU load and gives only error screen if needed. So it would be good to give any information available in static.

  24. Donncha O Caoimh
    Member
    Posted 6 years ago #

    Posterd - unfortunately checking the CPU load isn't a practical solution. How do you do it on a Windows box?
    Running "uptime" or executing a shell command is the easiest way I know of doing it in PHP and that causes load itself and only works on UNIX hosts.

    I'd like to hear from people who have this CPU load problem - does it go away if you disable compression?

  25. Rok
    Member
    Posted 6 years ago #

    Hello Donncha, I'm facing exactly same problems as rfischmann right after moving to DreamHost VPS from shared hosting. And for the past one+ month my blog is just dead. And top of all, I've started receiving about 500 trackback/pingback spams every single mintue, draining all available resources.

    I've tried all possible HTACCESS rules to avoid spammers generating PHP load, but to no avail., I'm truly sure, I've done something wrong.

    To cut short, the only alternative is to move elesewhere, as suggested by DreamHost.

    I just cann't go elsewhere (as suggested by some senior support members), because $70 advanced payment is quite big amount for me, and I cann't affoard to loose it.

    Still awaiting their reply, meanwhile the site as usual remains dead as it takes 4+ minutes to each HTTP request and dies with 500, 404, error establishing database connection etc. errors.

  26. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    And top of all, I've started receiving about 500 trackback/pingback spams every single mintue, draining all available resources.

    Rename or remove wp-trackback.php and xmlrpc.php to stop this for the time being. It'll kill trackback and pingback abilities, but the load will stop.

  27. Rok
    Member
    Posted 6 years ago #

    Hi Otto, did as you adviced. Just wondering, I've tried HTACCESS rules available on many well known blogs, claiming good % of success. But those rules are not working when I add into my HTACCESS (public folder).

    500 spams a minutes, it seems DOS HTTP attack.

    Here' is an example rule that's failing to work:

    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
    RewriteRule .* - [F]
    
    RewriteCond %{REQUEST_URI} .no-spammers.php*
    RewriteCond %{HTTP_REFERER} !.*mydomain.com.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule .* - [F])
    
    RewriteCond %{REQUEST_URI} .*/trackback/?.*
    RewriteRule .* - [F]
  28. aronchi
    Member
    Posted 6 years ago #

    If the ip is the same, you can use this .htaccess to avoid connections:

    <Limit GET HEAD POST>
    order deny,allow
    deny from 212.227.99.192
    deny from 74.54.21.66
    deny from 59.106.129.89
    deny from 88.241.161.99
    deny from 217.26.209.233
    deny from 195.225.178.29
    </LIMIT>

    Did you install mod_security or bad_behaviour?

    I have both and both are very useful to block intruders, spammers and hackers

  29. Rok
    Member
    Posted 6 years ago #

    Being on DreamHost at the moment, I probably may have mod_security installed.

    At the plugin front I'm using Akismet & WP-SpamFree.

  30. distobj
    Member
    Posted 6 years ago #

    FWIW, I had the same problem described here, and am also at Dreamhost. It happens with the latest versions of WP-Cache and WP-Super-Cache: a few minutes after activation, whammo, the number of httpd instances goes sky high, consuming available memory.

    What I did to fix it, was move the cache directory from wp-content/cache (NFS mounted) to /tmp/hostname-wp-cache (local) by changing the relevant line in wp-cache-config.php. Luckily my cache maxes out at about 10M, so it fits well in /tmp: YMMV.

Topic Closed

This topic has been closed to new replies.

About this Topic