Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to optimize my new website performance, my configuration is wordpress running on ubuntu 11.04 1G VPS with nginx/php-fpm/mysql. I used page caching, browser caching to make it faster. But there is something I need to understand: when I run a speed test using different online tools or firebug, there is a bottleneck on the first GET request, it takes 3 or 4 seconds waiting for the first byte from the server. after this the website load speed is acceptable. To explain it in another way, if you open the site from firefox for example, you will see the status bar stuck on "Waiting for" for 3 or 4 seconds. I want to understand what are the factors that controls this waiting time, and recommendations for optimizing.

share|improve this question

The delay in waiting for the first byte from the server could be one of a number of different things, including:

  1. Delay in DNS lookups
  2. Delay in server initiating a TCP session
  3. Delay in server sending request to server
  4. Delay in server sending back data once the request has been received.

Chrome's dev tools usually tells you which of these is the actual bottleneck, and only some of these are necessarily caused by server settings. I would find out which of these is causing the delay and work to resolve that.

Assuming you have no DNS, latency or bandwidth issues it sounds like the server might be taking a long time to generate the page output, either because it is overworked or because the application is just doing a lot and taking its time to render the page. Wordpress is known for being fairly chatty with databases (I've seen wordpress homepages make 500+ db queries before now), so I'd look to get one of the many php-profiling plugins and investigate if the application is generating the page in an acceptable amount of time. If the application is performant and the server still doesn't serve up the queries in a timely way, then that points more to a webserver configuration or server load issue.

share|improve this answer

Are you using the proxy features of nginx? nginx can buffer the response from the true server and then relay it to the client, so you may be seeing the delay from the buffering, if you have it enabled.

share|improve this answer
How to tell if I am using proxy features? – Ibrahim Hussein Jun 4 '12 at 20:07
Did you put the proxy_pass directive into your config file? – WaldenL Jun 4 '12 at 20:27
no proxy_pass. just fastcgi_pass – Ibrahim Hussein Jun 4 '12 at 20:34
I play w/the proxy_pass, not fastcgi_pass, but looking at the wiki I'd say they follow the same rules, as they both can use the backend directive too. So take a look for some of the buffering options of fast_cgi and see if you can turn it off, not sure if you can. – WaldenL Jun 5 '12 at 18:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.