Time to First Byte really long, why?
I've got a Linode 2048 VPS for one of my big blogs, and I'm experimenting issues with the load time. Running a simple test with Pingdom Tools gives me a wait time of around 11 seconds just to start getting data from the server.
As far as I know this is called "Time to first byte", and I can't understand why this is happening. My server is based in Nginx, PHP-FPM (5.3.3) and the latest WordPress 3.3 version.
The Pingdom report shows that first access to my blog,
Here you can find a screenshot to provide more information.
Could somebody help me with this?
Could it be an issue with the Linode configuration (not my webserver, I mean Linode dashboard)?
7 Replies
Anyway, if it is just a question of location… should I move my server out from Linode (London, which is pretty near to Madrid, where we work)?
@picajoso:
Could it be an issue with the Linode configuration (not my webserver, I mean Linode dashboard)?
This static image file:
comes back immediately. There seems to be a difference between your site serving static image files and other content, that should be a clue in finding the problem.
James
I requested the page at 13:18:25 GMT and the bottom of the page has:
I don't think it's Linode-related. It's probably either related to something on the PHP or the database side of things. Or, it could have been Pingdom's tool having a bad day.
I'm checking the logs, and there are lots of "closed keepalive connection", but as far as I know this is pretty normal and I can disable those warnings adding a "notice" at the end of the error_log directive.
Hoopycat, when you mention the hyper cache line, do you think that has something to do with the issue?
I've ran again the test, and the problem remains… (Spanish IP, again).
I was mentioning the hypercache thing because caching usually results in better performance. It would be worth keeping an eye on that as you try various things.
What are you using for a database server? If it's MySQL, try running mysqltuner.pl
Also, if you want a quick and easy way to isolate just this problem without any other effects or having to fire up a web browser,
$ curl --output /dev/null http://www.muycomputer.com/
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 104k 0 104k 0 0 9697 0 --:--:-- 0:00:11 --:--:-- 27876
You can run that from your Linode itself. You can also write the output to /tmp/something instead of /dev/null if you want to save the HTML for comparison. I actually wish I'd done that in the example I pasted above, because now when I do it, it completes in under a second!
You're using a caching plugin, which means that most visitors (like me) will see a cached version of your home page, which loads instantly. But some visitors will arrive on a cold cache, and WordPress will have to generate a new page from scratch. This can be much slower, especially if you use a badly written third-party plugin. Some WordPress plugins are really helpful, but some are just plain horrible. They could be sending really bad queries to your database, or they could be waiting too long for a remote API such as Twitter.
It's difficult to diagnose a WordPress performance issue while a caching plugin is enabled. Disable hyper cache for a while, and then use the slow query log (as hoopycat said) to see if there are any rogue queries. Re-enable hyper cache when you're done.