WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Apache RAM usage doubled after installing W3TC (7 posts)

  1. selfagency
    Member
    Posted 1 year ago #

    I host about 30 WordPress 3.5.1 sites on a Media Temple DV4 running Centos 5 with 2GB of RAM, PHP running behind Fast-CGI, and Apache running behind Nginx. Of these 30 sites, only three get significant traffic. The rest kind of just sit there.

    I have recently installed W3 Total Cache on all of these sites with the following enabled:

    Page cache
    Database cache
    Object cache
    Browser cache
    CDN with Amazon Cloudfront
    Cloudflare w/ medium security, automatic Rocket Loader, and CSS, JS & HTML minification

    I also recently had my Apache configuration professionally optimized by Media Temple's Otto service.

    Nonetheless, despite using CDN and Cloudflare in addition to W3TC, Apache's RAM usage has _DOUBLED_ from ~300MB to ~600MB literally overnight. My sites, despite having all this fancy caching now enabled, are now performing twice as slowly as they were before.

    If anything, that number of calls being made and the amount being called should be significantly reduced. Instead, it's killing my server.

    Here's a screenshot of what my Apache RAM usage looks like before and after I rolled out the plugin:

    http://d.1ski.me/image/241Z1U3a3C0X

    In addition, I also installed W3TC on a separate site on another server — a Rackspace Cloudsite. There too I am using the same settings above, but with WordPress/Jetpack's CDN and Cloudflare. Now, half the times you load a page, the site throws a server busy error, and every time you post, the site throws a timeout error.

    What the heck is going on with this plugin? It's like it does the exact opposite of what it is supposed to accomplish.

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 1 year ago #

    I'm not the author of the plugin, but I felt that some things should be pointed out here.

    First, I can think of no sane reason to have *all* of those different caches enabled. Some of them would probably conflict with other ones, in fact.

    Try turning off the database cache, since the object cache by itself will render that mostly pointless. Additionally, using page caching with Cloudflare also doesn't make a lot of sense.

    Secondly, if you're using a caching method that is in memory and not "Disk" for those various caches, then yes, RAM usage will rise. This is normal. That cached data has to be stored somewhere, and in persistent RAM is the best place for it. Running just the Object Cache on my relatively small site gives about 100 MB extra memory usage, but also makes the site about 6 times faster because of the reduced database calls.

    W3-Total-Cache is a decent tool, and it does have some minor problems, but you can't really just flip all the switches and expect it to work properly. You need to analyze what the bottleneck of the site's performance problem is, then intelligently enable only the pieces of it that will help assist you with that.

  3. efikim
    Member
    Posted 1 year ago #

    Samuel, my understanding of cloudflare is that it doesn't deliver cached pages unless the server fails to provide a page, but it does cache (and can in some cases combine/reorder) the static objects the page loads. if this is the case, page caching with W3TC would still make sense.

  4. CouponCodePlugin
    Member
    Posted 1 year ago #

    @selfagency cloudflare can cause more issues than it solves. All of my serious sites do not use cloudflare.
    I have seen ping times go through the roof for no good reason as well as "website is offline" messages when I am logged into the server and can clearly see that it is online and has 99% free resources.
    Cloudflare is free and you get what you pay for.
    Instead, I used max CDN and had 4 CDN addresses for each site. This caused the loading time to be less than a second. With times like this, adding cloudflare would do nothing at all.
    However, that being said, I do use cloudflare for sites that are free and will not make any money. This is done to save a bit of money when compared with a high end CDN.

    You should monitor your ram to make sure it drops and see what processes are running. You should see it drop. If not, disable the plugin and all its settings, then start over and activate one feature at a time, checking your resource usage before activating the next feature.
    You should also do a speed test with something like pingdom or webpagetest.org so that you can see where the bottlenecks are (as Otto mentioned). Then you can see what the issues are and address them.

  5. gooma2
    Member
    Posted 1 year ago #

    and selfagency, find out what caching your server is using too. I've learned the hard way that just putting on W3 Total Cache enabling everything hoping it'll work doesn't with this one.

    It's a powerful and very good plugin, but it's one you definitely have to spend some time with. It's a lot of testing and yes, there will be times when you make one change on it and your server load will go through the roof.

    If your server is using a caching like Varnish, Nginx, APC, etc. they also need to cache when you make a change on W3TC so sometimes that can make your server load go up. You need to wait a little bit and then see how the load handles and if it levels off.

    I can agree with CouponCodePlugin on CloudFlare. I now use Incapsula as that one really works beautifully with all your caching and W3 TC. It lets you choose whether you want to do that awful captcha if it doesn't recognize an IP (I hated that on CloudFlare it threw many false positives with that) and it also lets you know how many attacks your site may be getting from people looking for a weak spot.

    Just spend some time trying one thing at a time on W3 TC and see how the site reacts. I know it sounds not the most fun, but it will truly pay off in the long run.

  6. selfagency
    Member
    Posted 1 year ago #

    I'm trying to adjust settings per all of your advice. I just ran the compatibility check and I'm noticing some strangeness. Also, I should probably add that I'm running Plesk.

    I followed the directions on W3TC's install page to install memcache but when I grepped memcache in phpinfo afterwards, it returned no result. So the compatibility check is showing:

    Memcache extension: Not installed

    Same goes for APC. When I grepped it after installing (I had to compile it and memcache because it said phpize failed in both cases), it returned nothing.

    These are all active according to my httpd.conf file, but W3TC says it can't see them:

    mod_deflate: Not detected (required for disk enhanced Page Cache and Browser Cache)
    mod_env: Not detected (required for disk enhanced Page Cache and Browser Cache)
    mod_expires: Not detected (required for disk enhanced Page Cache and Browser Cache)
    mod_headers: Not detected (required for disk enhanced Page Cache and Browser Cache)
    mod_mime: Not detected (required for disk enhanced Page Cache and Browser Cache)
    mod_rewrite: Not detected (required for disk enhanced Page Cache and Browser Cache)
    mod_setenvif: Not detected (required for disk enhanced Page Cache and Browser Cache)

    Any thoughts?

  7. gooma2
    Member
    Posted 1 year ago #

    Memcache and APC are something that your hosting might need to install. If you have a vps or dedicated server, it should be no problem for them to do that.

    But I did learn that if you do have a dedicated singer processor server APC will be much faster and you could only tick that for Minify, Object and Database Caching on the General Settings tab of W3 TC. You would use Disk or Disk Enhanced for Page caching.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic