Very High TTFB for WordPress WooCommerce Site on NGINX

Dear All

We have spiritual item online website with Domain - which is running on CentOS 7 and NGINX web server on VPS with 12 GB RAM.

We have also used w3 total cache and MaxCDN Still when we check WEBPAGETEST report for my site it says 12 seconds for TTFB. Which is TOOOO High…

Please suggest some key points to reduce this… or some expert are also welcome as freelancer work…

Best to understand what WPT reports communicate.

  1. shows this site requires 5+ seconds to generate + return the site’s HTML, so browser knows what resources to start fetching.

  2. All resources serve slowly, so small .css files for example take a very long time to return.

This likely all revolves around poorly configured Apache + PHP (Opcache or APC, depending on PHP version) + MariaDB/MySQL (whichever is running).

  1. W3TC usually slows sites to a crawl. You can prove this to yourself by running ab (ApaceBench) against your site with W3TC active + inactive. Try ZenCache instead.

  2. Attempting to effect speed of this site using a CDN will likely be futile. Focus on TTFB first. details a list of experiments to run which might resolve your situation.

Dear Spiritual,

The loading time of your website is better as you can see at thanks to Cloudflare among others but TTFB is still very slow.

Feel free to send me a message if you want to optimize it even more.



Could you create a blank page and run a test on that?

If the TTFB is better, then you have a database query or a loop in your code taking to long.

Let me know

mrPerezMarc makes a good point.

Test speed of files by logging into your machine via ssh + running ApacheBench.

The command I use is…

ab -k -t 30 -n 10000000 -c 5 $URL

index.html - tests file system buffering (target 50,000+ reqs/sec)
index.php - tests PHP Opcache config (target 5,000+ reqs/sec)

Next up is mysqltuner to ensure your MariaDB/MySQL config is tuned.

After this you have a good starting point.

If any of your numbers are low for index.html or index.php best you fix these first.

I would try to disable the plugins one by one and see if any one of them is causing the trouble.

If they all add to the slow down, then look for replacements or simply for go that functionality if it is just a “nice to have”

I would also consider swapping W3 Total cache for some other caching plugin. I know from experience that W3 Total cache actually slows some sites down.

I would recommend ZenCache as it is one that I use on all my WordPress sites:

If you’re using cloudflare, then all bets are off TBH! You’ve just added an extra level of redirection to your site, and while it may deliver static content faster, it cannot improve the TTFB as it has to talk to your original site and act as a proxy server. It doesn’t have it’s own personal high speed internet, it’s having to use the same one as us.

The only way it could conceivably help is if your server is a very long way away from your target audience.

Ignoring the hate campaign against W3TC - which is just as good as any other WP cacher when correctly configured ( ignoring the current annoying nag screen ) - a WP / Woo site on a VPS sized to 12GB memory will function well, and only a poorly configured server ( or an appalling theme!!! ) will cause this poor level of performance. Database needs memory and PHP needs compute power to perform well.

I guarantee I can improve this for you! Drop me a line if interested. Worst case, I’ll recommend an alternate provider (:

Note: I see the site is in Germany, audience in India (?) and your helpdesk in the Vatican! Testing the site from the locality of your target audience is always a good idea.

Edit: I see you’re running on nginx and SSL. Both of these can be better configured!