WebPagetest Forums
How does webpagetest determine if TTFB grade - 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: How does webpagetest determine if TTFB grade (/showthread.php?tid=11441)



How does webpagetest determine if TTFB grade - trx - 07-18-2012 04:47 AM

Hello ,
How does webpagetest determine the TTFB? Is there some kind of formula base on the number of requests etc?

TRX


RE: How does webpagetest determine if TTFB grade - pmeenan - 07-18-2012 05:25 AM

The TTFB is for the base HTML and is measured from the start of the overall navigation.

WebPagetest uses the socket connect time for the base page as an estimate for the round-trip time to the server. It then takes the DNS time, socket connect time, SSL time and adds on one additional round trip as it's estimate for the fastest possible TTFB and then allows for 100ms on top of that.

Anything beyond the target TTFB time will lose a letter grade for each 100ms.


RE: How does webpagetest determine if TTFB grade - pmeenan - 07-18-2012 05:26 AM

oh, and as far as MEASURING the TTFB, it's just the time when the first byte of the base page (after any redirects) arrives from the beginning of the test.


RE: How does webpagetest determine if TTFB grade - trx - 07-18-2012 04:16 PM

What is checked ---> The target time is the time needed for the DNS, socket and SSL negotiations + 100ms. A single letter grade will be deducted for every 100ms beyond the target.

Let me know if this is correct:

http://www.webpagetest.org/result/120718_AE_56f9c2c92bc83ff6daa245a52d25b65f/1/details/

Start Offset: 0.111 s
DNS Lookup: 53 ms
Initial Connection: 57 ms
Time to First Byte: 517 ms

Total: 628 ms
Target --->
DNS lookup (53 ms) + Initial Connection (57 ms) + 100 ms = 208 ms

But webpagetest is saying the target is "171 ms Target First Byte Time".

Thoughts how how the target is calculated from the report above?

Thanks.

TRX


RE: How does webpagetest determine if TTFB grade - pmeenan - 07-19-2012 06:22 AM

Hmm - apparently there is a bug somewhere in the calculation that I need to track down.

Should be:
DNS Lookup (53ms) + Initial Connect (57ms) + 1 round trip (57ms) = 167ms (and then a 100ms allowance before a grade reduction). Could be that the difference between 167 and 171 is some gap time between the individual steps


RE: How does webpagetest determine if TTFB grade - trx - 07-19-2012 10:13 AM

Assuming you fix the bug, the target is 171 ms, and if the TTFB is 271, then it's graded a A or B? If A, then at 371 it would be graded a B.

Let me know.

Thanks.


RE: How does webpagetest determine if TTFB grade - pmeenan - 07-19-2012 10:20 AM

171-270ms would be an A, 271-370 B, etc. So as long as the server time was < 100ms it would get an A.


RE: How does webpagetest determine if TTFB grade - trx - 07-19-2012 10:28 AM

Thanks!


RE: How does webpagetest determine if TTFB grade - whinynil - 02-17-2017 08:08 AM

Hi, I know this is an old thread but I wanted to revive it because I had a question about calculating the First Byte Time score if using the API.

When looking at a response from the API, it looks like DNS Lookup is available via dns_lookups. And TTFB is available via time_to_first_byte_ms. But I don't see how I can get Initial Connection or Start Offset. Are these unavailable via the API or am I just missing some way to access them? I could not find anything about them in the documentation here: https://sites.google.com/a/webpagetest.org/docs/advanced-features/raw-test-results.

Thanks for your help.


RE: How does webpagetest determine if TTFB grade - pmeenan - 02-17-2017 11:09 PM

dns_lookups is a count, not the timing. if you want the timings for individual components you need to look at the request timings. At the top level there is a server RTT which is the socket connect time to the origin for the base page which is used in the grade calculation.