Support » Plugins » [Plugin: W3 Total Cache] Huge TTFB when I use plugin

  • Hi everyone,

    I have a new and quite complex wordpress site that loads in over 15 seconds with a 793ms TTFB. When I turn on the plugin, even if I disable all settings apart from one (e.g. just keep minify) then the TTFB rockets massively to 19 full seconds!

    I’m not really sure how to even start troubleshooting this.. any help would be really appreciated.

    Here’s the webpagetest links: without W3TC, with W3TC.

    Any help welcome!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Always willing to help a member of the punk/indie community. DIY or DIE.

    What is your hosting setup? Shared, VPS, EC2?
    What are your settings for W3TC?

    If you are on shared hosting, most likely you should just go with file cache for page and minify, and no cache for database & objects (to begin). After you get file, browser, minify settings sorted, then you can try database & object cache to see if there is any benefit. Sometimes a shared hosting environment has a slow queue for mysql databases, and it’s beneficial to cache… but sometimes the mysql server is quicker than the web server.

    If you are on dedicated hosting, there is a lot you can do to optimize apache and mysql to the amount of dedicated RAM on the server, and of course install APC (if you are not on Cpanel or Plesk).

    The fundamentals of proper Apache and MySQL tuning are most important. The default configs for these servers are “designed to fail” under load.

    Your page loads up a ton of content from lots of different syndicators, so it’s difficult to tell where the big lags are occurring. But your test graph shows long TTFB and a lag on[…].ro

    The first non-logged client visit is going to be the one that triggers all of the caching, so it is sometimes slow.

    Non-related, are you a member of #it ( ? If not, I will send you an invite if you send a message to

    That super high TTFB with w3 enabled does look like trouble.

    Again, we need more info about your server and your W#TC setup to give advice…

    Hi Gilligan

    Thanks so much for your advice! I’m on a dedicated server here, and I only have page caching and minify turned on for now. I think the issue is I don’t have the expertise to do the apache/mysql tuning. I have a server administrator who has done some work but I think we’ve reached the point where he needs some guidance too! We have memcache enabled but not APC.

    The laggy connections to dev…ro and flickr are only temporary – some erroneous hard-coded image links that I shall fix. Otherwise the other syndicators are almost all from my google adsense code, damn. Going to need to keep that for the moment!

    What other details can I provide for you to help?

    Thanks again

    PS haven’t heard of that torrents site but we’re all about the independent artists so not sure they’d appreciate us linking to it!

    How much dedicated RAM do you have on the server?
    What OS& Version?
    Apache version and loaded modules?
    Control panel such as Cpanel or Plesk?
    MySQL major version, and are you running mysqli or mysql database connection?
    What other software packages are you running?

    I do consulting work on this sort of tuning, can give references if you like. Or I can give your sysadmin some advice on how to easily tune httpd.conf for the amount of RAM, and give you some suggested my.cnf settings as well.

    @borrodell were you using disk enhanced page caching method? If so did you check the HTML comments in the footer HTML to see if the date / time changed upon every page refresh? If it did, caching wasn’t working for you due to some conflicting code in your themes / plugins (likely) or incomplete installation (less likely). Either way, temporarily switching to the twentyeleven theme and deactivating other plugins will shown you where the problem lies as you re-activate things one-by-one.

    Hi Gilligan, and Hi Frederick

    The server details I have are the following:
    – Intel Core2 Duo E6320
    – 3GB Memory
    – 160GB 7200rpm Hard Disk
    – CentOS 5.x
    – Webmin cpanel
    – MySQL 5.1.5 and I believe it’s database connection but I may be wrong
    ..and I have asked for more details on the other bits.

    Gilligan, if this isn’t sorted by the weekend then I’d love to have your professional eye on it if you think you could adjust the settings/tunings correctly to get us really fast, or at least understand what our bottlenecks are.

    Frederick, you’re absolutely right – I have disk enhanced page caching on and the debug reveals that it is NOT cached (full details below).

    I have de-activated all plugins to no effect. I have just changed it to the twentyeleven theme.. and the site loads lightning fast! BUT I believe this is because it’s not fetching any real content up, rather than the caching. The debug code below remains the same when I change to twentyeleven, except that the creation time changes from ~17s to 0.231s

    Hope this gives you both more information? Really very much appreciated

    <!-- W3 Total Cache: Minify debug info:
    Engine:             disk: basic
    Theme:              8c84c
    Template:           index
    <!-- Performance optimized by W3 Total Cache. Learn more:
    Served from: @ 2012-02-22 22:29:38 -->
    <!-- W3 Total Cache: Page cache debug info:
    Engine:             disk: enhanced
    Cache key:          wpnew/wordpress/_index.html
    Caching:            enabled
    Status:             not cached
    Creation Time:      17.660s
    Header info:
    Content-Type:       text/html; charset=UTF-8
    Last-Modified:      Wed, 22 Feb 2012 22:29:38 GMT
    Vary:               Cookie

    I have disk enhanced page caching on and the debug reveals that it is NOT cached (full details below).

    The debug code below remains the same when I change to twentyeleven, except that the creation time changes from ~17s to 0.231s

    This is really weird. I’d recommend checking the folder permissions on your site’s wp-content/w3tc, if you have not done so already. 🙂

    Hi Gilligan, Frederick, Pothi

    @pothi the permissions are all 755. Should they be different?

    To test what’s going on, I have changed to the the twentyeleven theme, disabled all plugins, and re-installed w3tc.

    The result is a few different things.

    1. minify is working
    2. object caching (disk:basic) is enabled and working – calls 656 hits 648 misses 8

    3. db cache (disk:basic) is enabled but not working or cached – queries 7 cached 0
    4. page cache (disk:enhanced) is enabled but not working, status: not cached.

    @frederick — the page cache debug info Last-Modified time does change on each page refresh.

    Any further advice very welcome!
    Thanks all

    PS see the site and it’s debug code turned on here:

    You should be able to easily install APC and get it running on that server.

    Sometimes it is easier to run Virtualmin GPL to help get all things sorted, but it is really more for multiple virtual domains… but on a 3GB server you should be able to host a few sites, or at least a self-hosted CDN. Virtualmin is a virtual domain hosting module for Webmin.

    So, how is your domain set up? Is it a virtual domain under /home/username/public_html, or is it the default at /var/www/html? or some other setup?

    Are you running php as mod_php or as fastcgi (fcgid)?

    I have had very good success running Virtualmin Pro (paid) and Virtualmin GPL (free) on similar hardware/OS, with APC support for all caches.

    I will get back to you re: email request ASAP.

    Hi James,

    Basically, that folder needs write access by the user that handles the files. If not using suPHP, then the webserver needs the write access to that folder. Basically, it depends on how the server is set up.

    The recommendations from Gilligan may come in handy for your particular setup.


    @borrodell, focus on making sure that W3TC is creating cache files because that’s the best sign that things are in order. Be careful enabling object and database caching. Focus on page caching and browser caching to start.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: W3 Total Cache] Huge TTFB when I use plugin’ is closed to new replies.