Current time: 12-11-2017, 10:28 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Sometimes Long Time to First Byte Time for the first request
11-15-2013, 10:21 AM (This post was last modified: 11-15-2013 10:21 AM by BITS.)
Post: #11
RE: Sometimes Long Time to First Byte Time for the first request
(11-14-2013 06:07 PM)robzilla Wrote:  
Quote:Further question: Is there any possibility that this is not a server-side issue? If not, then I will probably change my provider.

You always seem to use the Falkenstein test instance, so I would suggest trying a few other WPT test locations to see if they show similar results. If they do, then I would probably contact the hosting provider about this first, to see if they might have a clue.

I tried Irland and Amsterdam as well, still the same result:
http://www.webpagetest.org/result/131114...d138e86c3/
http://www.webpagetest.org/result/131115...0548fd965e

Quote:My provider says, everything is ok (the provider checked it twice in the meantime)
Find all posts by this user
Quote this message in a reply
11-15-2013, 10:36 AM
Post: #12
RE: Sometimes Long Time to First Byte Time for the first request
Upload a blank html file on your host, and test it to see if you get the same TTFB. If it's the same then the cause is the server, if it's not the cause is your website.
Find all posts by this user
Quote this message in a reply
11-15-2013, 06:49 PM
Post: #13
RE: Sometimes Long Time to First Byte Time for the first request
One more thing you could try is profiling your PHP with XDebug or New Relic. Run your tests again with one of those installed and you should be able to see where the backend spends most of its time during those requests with a long TTFB.
Find all posts by this user
Quote this message in a reply
11-16-2013, 04:26 AM (This post was last modified: 11-16-2013 04:27 AM by BITS.)
Post: #14
RE: Sometimes Long Time to First Byte Time for the first request
(11-15-2013 10:36 AM)Wu4D Wrote:  Upload a blank html file on your host, and test it to see if you get the same TTFB. If it's the same then the cause is the server, if it's not the cause is your website.

Thank you for this tip. I just uploaded a html page with a headline and a few pictures. The result: Sometimes long TTFBs like this:

http://www.webpagetest.org/result/131115...8/details/

@robzilla: Thank you for your answer. I will try one of these tools in the next couple of days.
Find all posts by this user
Quote this message in a reply
11-16-2013, 09:38 AM
Post: #15
RE: Sometimes Long Time to First Byte Time for the first request
(11-16-2013 04:26 AM)BITS Wrote:  
(11-15-2013 10:36 AM)Wu4D Wrote:  Upload a blank html file on your host, and test it to see if you get the same TTFB. If it's the same then the cause is the server, if it's not the cause is your website.

Thank you for this tip. I just uploaded a html page with a headline and a few pictures. The result: Sometimes long TTFBs like this:

http://www.webpagetest.org/result/131115...8/details/
I see no increse in TTFB for the html file but I do see increse in TTFB for images. Maybe your server has something that optimizes images. So that on every image request the image get's resized, or smushed. Do you also see increse in TTFB for .css and js?
Find all posts by this user
Quote this message in a reply
11-16-2013, 11:07 AM
Post: #16
RE: Sometimes Long Time to First Byte Time for the first request
Right, sorry, I forgot you were also experiencing long TTFBs on static resources. It's looking more and more like a hardware issue, but since it's very irregular, your is not going to notice it. Try hosting your site elsewhere temporarily to see if it makes a difference.
Find all posts by this user
Quote this message in a reply
11-19-2013, 12:55 AM
Post: #17
RE: Sometimes Long Time to First Byte Time for the first request
It could also be an apache configuration issue if your are running out of clients to handle the requests. If you are running prefork MPM then each connection ties up one of your clients for the life of the connection, even if it is just sitting around (which is a problem with keep-alive).

Some of the other MPM's are more sane but depending on how you have php integrated may not work. These days I usually run nginx or varnish in front of Apache (on the same box) if I absolutely HAVE to run Apache.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-19-2013, 03:44 AM
Post: #18
RE: Sometimes Long Time to First Byte Time for the first request
Thanks for the responses.

@Wu4D: Sometimes the long TTFB also appears for JavaScript and CSS Files.

@robzilla: I asked me provider to move my website to another server if they could not find any problem. They will now check the performance issue the third time.

@pmeenan: Apache is working with prefork. I adjusted the settings for prefork a few weeks ago to:

Code:
<IfModule prefork.c>
StartServers 3
MinSpareServers 3
MaxSpareServers 10
ServerLimit 100
MaxClients 100
MaxRequestsPerChild 4000
</IfModule>

I am doing all my tests during the night at about 3-5am, so there is not much traffic on the site.
Find all posts by this user
Quote this message in a reply
11-21-2013, 09:14 AM
Post: #19
RE: Sometimes Long Time to First Byte Time for the first request
You have a very slow server and Word Press is a very inefficient page generator.

I checked your server to server transmission time and it is a very slow at 30-40 KBytes/sec.

If you are on a shared server large variations are normal. Especially during busy times of the day like early evening. You may get more consistent results at 3:00am. It's not just the server speed. It can be the Service Provides infrastructure. Too much traffic on the local network.

Your DNS resolution is very fast so that's not an issue.

Your HTML (Request #1) is very fast for a Word Press page. I have to assume the CPU has plenty of capacity. And your caching plug-in is working well at that point in time. Word Press is not the issue and a CPU processing bottleneck is unlikely.

Now I see the problem.

Where it becomes evident that it is a data server issue is when you look at request #24 & #25 on your results in your first post. I presume there was something going on with the server at that point in time. Request #24 has a 1.8 sec. TTFB which on an image file is an abominably. It is either the CPU is is highly being over utilized by another process or more likely the data bus from the Hard Drive is blocked. The connection time is 39mS and followed by the 1.8 sec wait. Only those two images have long TTFB issues. It is not file size dependent either. Request #25 is a 300 Byte file with a 925mS TTFB. So there must have been something going on on the server at that point in time and similarly to a lesser degree around the time of request #7 with a 727mS TTFB. Most request have typically a 70 mS TTFB.

My best guess, without knowing how many sites are hosted on the server and if there is a local drive or if it's using Network Attached Storage, that there is an intermittent data access issue. All indicators point to a data access delay. I just do not know the cause.
Find all posts by this user
Quote this message in a reply
06-10-2014, 04:07 PM (This post was last modified: 06-10-2014 04:08 PM by BITS.)
Post: #20
RE: Sometimes Long Time to First Byte Time for the first request
Hi iSpeedLink,

sorry for the really late response and for digging out this thread again. After I had reduced the amount of GET-Requests the monitored delays decreased. But: They sometimes - even it's rare - occure.

(11-21-2013 09:14 AM)iSpeedLink.com Wrote:  You have a very slow server and Word Press is a very inefficient page generator.
I checked your server to server transmission time and it is a very slow at 30-40 KBytes/sec.

That's an interesting fact. Can you tell me how you have measured this?

(11-21-2013 09:14 AM)iSpeedLink.com Wrote:  My best guess, without knowing how many sites are hosted on the server and if there is a local drive or if it's using Network Attached Storage, that there is an intermittent data access issue. All indicators point to a data access delay. I just do not know the cause.

I also don't know how many sites are hosted on the server, but I will ask my provider how many VPS the hardware has to manage. Do you have any ideas how to measure an data access delay?
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)