nginx – Extremely High TTFB on WordPress website – Not dabase or server … what else could cause it?

I’m running a WordPress ecommerce website on a dedicated VPS with 4CPUs and 6gb RAM, so resources are not an issue . On top of this I have VestaCP installed, with a Nginx + Apache + Php-FPM server . Also using clouflare caching together with WP Rocket, which have worked together the best out of all tests so far .

After deploying the website in question I have been struggling with unbearably high TTFB times which account for around 2.5seconds average from multiple locations I have tested using KeyCDN .

So I made a new fresh wordpress install and realized that even though my TTFB still isn’t the best, I could reach around 400 to 500ms average from multiple locations .

This allowed me to rule out the possibility of having a bottleneck at the server side so after a bit more debugging and installing WordPress Query Monitor, I realized the total number of calls being done to the database only accounts for 0.09 seconds, so the database also does not seem to be an issue unless it’s causing a huge delay even before the first query after TTFB ends runs .

Another thing I have done was to disable every plugin but that also didn’t seem to help much, perhaps it took 300ms or so to the total loading time during the wait (TTFB) .

I feel a bit lost here and at this point am not sure what else I could do in order to debug this or what might be causing it .

Even though the db queries are running fast it still feels as it’s the database that hangs for a while before the website starts loading .

Would really appreciate some insights on how to further debug this issue and how to rule out the database as a bottleneck .

Thanks

Reduce TTFB Cpanel / WHM Server

Reduce TTFB Cpanel / WHM Server | Web Hosting Talk


‘);
var sidebar_align = ‘right’;
var content_container_margin = parseInt(‘350px’);
var sidebar_width = parseInt(‘330px’);
//–>









  1. Reduce TTFB Cpanel / WHM Server


    Hello .. we have a server in which we have noticed the TTFB very high, we use cpanel + apache + cloudlinux and we would like to know experiences on how to improve that aspect and reduce the TTFB a little .. someone can tell us experiences about it .. or some way to improve that value ??

    Thank you

    Cpanel Hosting Domains, Reseller Plans
    Email Cloud, VPS, Moodle Cloud, Zimbra ,Services and Specialized Consulting
    Much more for the Latin American market and in Spanish
    Visit Our Page X5 Servers o Or Write us an Email













Similar Threads


  1. Replies: 1


    Last Post: 02-17-2003, 11:34 PM


  2. Replies: 5


    Last Post: 07-14-2001, 09:02 PM


  3. Replies: 0


    Last Post: 07-06-2001, 05:22 AM

Tags for this Thread



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  








Domain Name System – Debian CT inconsistently suffers from high TTFB with LEMP

I have my own router and hardware and I am responsible for my own networking. My HTTP frontend is on Debian 10 in an LXC container on Proxmox.

The web front end of my largest site suffers from extremely high TTFB. I have excluded Cloudflare, MySQL, PHP, NGINX and my own VPN.

This is a waterfall for an HTML document.
Brave waterfall with high TTFB

This is a waterfall for exactly the same HTML document when reloaded.
Brave waterfall with fast TTFB

The only thing that differs is the try. Everything else is identical. I can F5 and always get consistently.

This is the result of a CURL for more accurate measurements.

   time_namelookup: 0.510097
      time_connect: 0.685818
   time_appconnect: 0.000000
  time_pretransfer: 0.685864
     time_redirect: 0.000000
time_starttransfer: 0.861670

My natural ping to this device is 175 ms, which is +3 ms above the natural ping to the test IPs for my data center. So I don't think it's a router problem either.

I read that it could be DNS. I use Google's public DNS. I ran dig and I also get inconsistent response times.

;; Query time: 8 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Jan 31 14:22:37 UTC 2020
;; MSG SIZE  rcvd: 57
;; Query time: 174 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Jan 31 14:22:18 UTC 2020
;; MSG SIZE  rcvd: 57

It's 50/50 if I get the 150ms or 8ms by digging over and over again.

Pining 8.8.8.8 is fine, however.

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=8.25 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=8.17 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=13.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=8.22 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=57 time=8.18 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=57 time=8.22 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=57 time=8.24 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=57 time=8.23 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=57 time=8.20 ms
64 bytes from 8.8.8.8: icmp_seq=10 ttl=57 time=8.36 ms

Interesting, try it dig Cloudflare-managed domains consistently achieve low MS values. My SSL certificates come from LetsEncrypt, and my SSL certificate that Cloudflare communicates with is also LetsEncrypt. The LetsEncrypt certificate contains multiple domains, some of them activated outside of Cloudflare and others activated.

However, it cannot be just the SSL certificate, as testing non-HTTPS versions of the site still shows a strange variation of at least 150 ms.

PHP – How to check in CentOS 7.7 which process takes 1 minute because the page is loaded slowly (TTFB 1 minute)

I am using CentOS version 7.7.
A few days ago my frontend page (not whole website) is TTFB exactly 1 min.
How can I check which process causes this?
I use PHP 7.3 php-fpm ON

Is there a way to check which process causes the first byte to wait 60 seconds?

https://i.stack.imgur.com/sYGze.png

This error occurred several times a day. The page availability is therefore 88%. My start page was down because of 12% (TTFB 1 minute). Please help, it is very urgent for me

Average TTFB (Time to First Byte) for a Shared Reseller?

Hello everybody,

My host recently switched all resellers to their new high-performance cloud infrastructure. At least we were so advertised.

Since then, I have received complaints from some of my more serious customers that the TTFB (Time To First Byte) on their website is more than 10 seconds when testing their website with GTMetrix.

This ultimately harms their SEO as we know that Google penalizes slow websites. (Google it)

When I looked from the end, he was absolutely correct. The TTFB was terrible! I immediately contacted my host to let him know, and he quickly started troubleshooting and problem solving.

Since my report to them, they've worked closely with the manufacturer to make configuration changes, migrate hypervisors, reboot the cloud infrastructure, resynchronize disks, and so on.

All this work has improved the TTFB to 3 seconds, but I still think that's not good at all.

I have compared the TTFB with other hosting providers, where I also have accounts and their TTFB is every 200 ms and below.

I've researched this and all the content I read says that an optimal TTFB should be 200 ms and below what I see with my other hosting providers. (Another Google It)

I have sent follow-up emails to my host and I need to hear something from them. It is almost 3 weeks ago and the problem persists.

Needless to say that my customers are not happy at all and are thinking about going and how can I stop them? I can not, because in my opinion, they have a valid reason.

So my question is: what is your average TTFB at your reseller host? I'd like to get an idea of ​​what others are experiencing and what the average TTFB should be on shared reseller servers.

Thank you very much

mysql – PHP, which was loaded into a subdirectory, has a much slower TTFB than in root

I'm using two identical Azure web application services (IIS) with PHP 7.3 and 32 bits.

On webservice1.comI have WordPress installed in the root. This has a TTFB of 225,24ms,

On webservice2.comI have copied all WordPress files from the internet webservice1.com roots in webservice2.com/blog, I now have a TTFB of 7.88 seconds, This problem occurs every time you load PHP pages on webservice2.com/blog. webservice2.com Contains a number of static content in the root directory and in other subdirectories.

Why could that be? Both refer to the same Azure database for mySQL servers, MySQL Version 5.7.

I'm working on it right now, so I do not have much server experience. I would appreciate any insight, having dealt with it for about a day.

Note: I am familiar with the configuration steps to move WordPress sites between domains and the required database changes. I'm not asking about this process. This problem persists even when I make these changes.

Thanks a lot!

FastCGI to improve TTFB when using NGINX as reverse proxy?

I try to shorten the time to the first byte. HTTP2 helped a lot, but TTFB is still between 500 and 700 ms. I would like to reduce it to about 200.

I have seen some suggestions for using FastCGI. I have a bit of a tricky setup, so I'm trying to understand where / how I would set it up:

I have a WordPress app on the Apache server listening on port 8090. This is easy to have a WordPress dashboard, provide API endpoints, and deliver media. My second NextJS app is on Nodejs listening on port 8000. This consumes the WordPress API and actually renders the site.

Nginx is ahead of these two apps to perform https / www redirects and proxy requests to the respective ports.

As far as I can see, at least all assets and pages are provided by Nginx. e.g .: curl -I -L https://www.example.com/wordpress/wp-content/uploads/2015/05/image.jpg – Answer heads tell me that Nginx serves them.

But I'm still confused as to whether it makes sense to set up FastCGI on Nginx. I still suspect Apache will be doing the PHP execution since I originally set up WordPress with the default Apache droplet and put Nginx ahead of it. Am I wrong? How can I improve the TTFB in this case? Maybe I should even look at my Node app, but I'm not sure where the delay is coming from.

Here is my /etc/nginx/sites-available/example.com:

Server {
listen to 80;
Server name example.com www.example.com;
rewrite ^ / (. *) https://www.example.com/$1 permanent;
}
Server {
listen 443 ssl http2 default_server;
listen [::]: 443 ssl http2 default_server;
root / var / www / html;

index index.php index.js index.html index.htm index.nginx-debian.html;

Server name example.com;
return 301 https: //www.example.com$request_uri;
ssl_certificate /home/ssl/example.com.chained.crt;
ssl_certificate_key /home/ssl/example.com.key;

Location / {
proxy_pass http: // localhost: 8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $ http_upgrade;
proxy_set_header Connection & # 39; upgrade & # 39 ;;
proxy_set_header Host $ host;
proxy_cache_bypass $ http_upgrade;
}

location / wordpress {
proxy_pass http: // localhost: 8090;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto $ -Schema;
proxy_set_header Upgrade $ http_upgrade;
proxy_set_header Connection & # 39; upgrade & # 39 ;;
proxy_set_header Host $ host;
proxy_cache_bypass $ http_upgrade;
}
}

Server {
hear 443 ssl http2;
listen [::]: 443 ssl http2;

root / var / www / html;

index index.php index.js index.html index.htm index.nginx-debian.html;

Server name www.example.com;
ssl_certificate /home/ssl/example.com.chained.crt;
ssl_certificate_key /home/ssl/example.com.key;

Location / {
proxy_pass http: // localhost: 8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $ http_upgrade;
proxy_set_header Connection & # 39; upgrade & # 39 ;;
proxy_set_header Host $ host;
proxy_cache_bypass $ http_upgrade;
}

location / wordpress {
proxy_pass http: // localhost: 8090;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto $ -Schema;
proxy_set_header Upgrade $ http_upgrade;
proxy_set_header Connection & # 39; upgrade & # 39 ;;
proxy_set_header Host $ host;
proxy_cache_bypass $ http_upgrade;
}
}

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123