Interview Prep/Networking/Performance, MTU, Latency & Tools

How do you measure where time goes in a slow HTTP request?

BeginnerScenarioPerformance, MTU, Latency & Tools
Answer

Situation read → Break the request into DNS, connect, TLS, first byte and transfer.

What I'd do →

  1. Run curl -o /dev/null -s -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} ttfb=%{time_starttransfer} total=%{time_total}\n' https://example.com
  2. High dns means resolver trouble
  3. High connect means network path or SYN drops
  4. High tls means handshake cost
  5. High ttfb minus tls means the backend is slow

Why → Each phase points to a different layer and a different owner.

Interview tip → Say you keep a curl format file for this in your toolkit.

All Networking questions Roadmap: Networking for DevOps

More on Performance, MTU, Latency & Tools