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
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.
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.
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/[hr]
400mhz was a typo. it’s 400mhz buy it is spread over 16 cores so each core has only 250mhz.[hr]
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.
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.
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.
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.
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.