Learn

VISUAL GUIDE · FOUNDATIONS & ESTIMATION

Follow a web request

Step 10 of 10: Fix the server time too

STEP 10 / 10ORIGINAL SKETCH
shop.example?SQL queryshort hopwarm connectionBrowserMumbaiDNS resolvercaches answersAuthoritativeDNSNearby edgealso MumbaiApp serverVirginiaDatabaseindexed, ~15 ms
A browser looks up a name through a DNS resolver, opens a connection to a distant app server that queries a database, and later goes through a nearby edge that keeps a warm connection to the server.

Where the time goesIllustrative · see assumptions

  • DNS lookup80 ms
  • TCP + TLS to edge20 ms
  • Browser to edge and back10 ms
  • Edge to server and back200 ms
  • App code30 ms
  • Indexed query15 ms
  • Query time saved385 ms

Total ≈ 740 ms

10 / 10
  1. Slow page
  2. DNS lookup
  3. TCP setup
  4. TLS setup
  5. Request sent
  6. Server work
  7. Response
  8. Reuse
  9. Nearby edge
  10. Fix the query

STEP 10 OF 10 · FIX THE QUERY

Fix the server time too

The last big slice is the query. Adding an index on the filtered column turns a scan into a lookup, about 15 ms instead of 400.

With the edge and the index together, a first visit lands around 355 ms and a repeat click on the open connection around 255 ms. Either change alone still leaves you above 700 ms.

Why it matters. Network fixes and server fixes stack. The breakdown tells you to do both, and in which order, instead of debating one.