cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Server Time vs TTFB

edmund_kueh
Contributor

In this particular example, the server time is 0.1s while TTFB is 0.5s. Why is there a discrepancy between server time and TTFB ? Shouldn't server time equivalent to TTFB ?

ttfb.png

5 REPLIES 5

JamesKitson
Dynatrace Leader
Dynatrace Leader

Server time is going to be the time spent receiving the request and creating and sending the response back to the client on the server side. Time to first byte is going to be the time from when the request is sent from the client to when the first byte of the response is received from the server - so this will include transport/network time.

So TTFB should always be higher than the server time.

James

edmund_kueh
Contributor
@James K

Thanks for your reply.

Nevertheless, there can be scenario where TTFB is equal to server time. Does this mean in this case, the transport time/network time is negligible ?

I suppose it's possible that in a very low latency environment that they will be nearly equal. They might appear the same after being rounded but there will always be some transport time.

AlexanderSommer
Dynatrace Pro
Dynatrace Pro

These metrics are based on the W3C navigation timings, so please take also a look at: https://www.w3.org/TR/navigation-timing/#processin...

  • TTFB is equal to response start
  • Server time is calculated by: TTFB - request start

Please look also at: What are the exact definitions of the Action Duration Contributors?

Please, let me know if that helps.

edmund_kueh
Contributor

@ Alexander S.

Good stuff. It helps.

From the formula above, it is clear that TTFB > Server time.

Secondly, am I right to say that the network consumption formula below includes time to redirect, time to resolve the DNS and time to establish the TCP connection ?


  • Network consumption: (requestStart - actionStart) + (responseEnd - responseStart)