WebPagetest Forums
inconsistent ttfb - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: inconsistent ttfb (/showthread.php?tid=10787)



inconsistent ttfb - bentham - 03-21-2012 01:42 PM

Hi,
I host my website on a vps server with 3GB of ram and 400mhz cpu divided on 16 cores.
Problem is that the site suffer from long and inconsistent time to first byte. Time to first bit can be anything between 1 second to 5 seconds.
My question is if this issue (inconsistency) is related to the vps provider or to server configuration. Thanks


RE: inconsistent ttfb - pmeenan - 03-21-2012 09:41 PM

More likely it is the actual application code itself (combined possibly with server configuration). Is the 400Mhz a typo? If not, matching that little CPU against 3GB of Ram seems to be quite unbalanced.

If you are running something like Wordpress then there are plugins that can help you track down the source of the problem. Otherwise tools like New Relic and Dynatrace are very helpful. Worst-case there's always old-school debugging techniques of instrumenting things to find the source of the problem.

You'll also want to check your apache stats (assuming it is apache) to see if you are running out of clients or file descriptors or any other finite resource.

If you're using a database you can turn on slow query logging to capture those but you may get more from instrumenting the app.


RE: inconsistent ttfb - pmeenan - 03-21-2012 09:42 PM

Oh, and for the record, even 1 second is pretty long for TTFB. I wouldn't be surprised if you could significantly reduce the variability as you improve that as well.


RE: inconsistent ttfb - bentham - 03-21-2012 09:49 PM

I forgot to mention that the website has no traffic at all at the moment (under development).
Here are some tests results :
http://www.webpagetest.org/result/120321_05_3NKZ5/
http://www.webpagetest.org/result/120321_YG_3NM9K/
http://www.webpagetest.org/result/120321_7B_3NNMH/
http://www.webpagetest.org/result/120321_T7_3NKQK/
400mhz was a typo. it's 400mhz buy it is spread over 16 cores so each core has only 250mhz.
Thanks for your reply. I am aware that 1 second for ttfb is too long. At the moment i am interested to know if the cause is the vps provider or not. If it's not the provider i will my admin to deal with it. I run on the server 1 Magento store with no visitors. My main question is if it's possible to have an inconsistent results with a good VPS or if the VPS is causing the problem. Thanks again for your help.


RE: inconsistent ttfb - pmeenan - 03-21-2012 10:21 PM

An interesting point is that even the static resources are quite variable and take a long time to serve. I'm not sure about the specific VPS you are on but in general it is quite possible to have stable and fast results on a VPS. It is also possible to have variable results on a good VPS depending on the application logic but in this case it looks like you have a server or web server configuration problem. The jpeg's for the skin should be coming back a lot faster than that.

Could still be a server configuration problem (if it is php, how the server calls php can be a big deal - module, cgi, fcgi, fpm - particularly when resources are constrained). I expect you'd be a lot better of with the same CPU power spread across significantly fewer cores.


RE: inconsistent ttfb - bentham - 03-21-2012 11:09 PM

Thanks for your reply and the info.
VPS is from server4you.
So the bottom line is that it could be both the server or the configuration? My problem is that my server management company tells me it's a server issue and my vps provider tells me it's a server optimization issue.
Thanks again for your help.


RE: inconsistent ttfb - pmeenan - 03-21-2012 11:15 PM

Is your application portable enough that you can try it on another server (with the same configuration)?

They are both probably right to some extent. The server isn't capable enough to run the site as-configured and the site isn't configured to run optimally on the server. My guess is that it will actually take a lot of tuning to make an application perform well when it is scaled across that many low-CPU threads.


RE: inconsistent ttfb - bentham - 03-22-2012 12:32 AM

Thank you very much.
I find it very strange they chose to spread the cpu power over so many cores. Wondering what would be the reason for them to do it. Anyhow, I asked them if it is possible to get the same power over 1 or 2 cores only.
I had the same configuration over a different vps at a different company with less memory and less cpu power and it is working fine.
Thanks again for your help.