Octet

How do you prove whether a slowness problem is the network or the application?

Show the answer

Say this first

I split one transaction into its parts with a capture near the client. The TCP handshake (SYN to SYN-ACK) is almost pure network round trip. The time from the request to the first byte of the response, minus one round trip, is server think time. If the handshake takes 2 ms and the response 4 seconds, the network is not the problem. If the handshake is slow, or I see retransmissions and stalls in the data, the network is involved. I bring numbers, not opinions.

Go deeper

One request, timed

Output
t=0.000   client  SYN
t=0.002   server  SYN-ACK          <- network round trip about 2 ms
t=0.002   client  ACK
t=0.003   TLS handshake begins, finished by t=0.009
t=0.010   client  HTTP GET /report
t=0.012   server  ACK              <- request delivered
t=4.215   server  first response byte   <- about 4.2 s of server time

Wireshark helpers

  • tcp.analysis.ack_rtt shows how quickly segments were acknowledged.
  • For clear-text HTTP, the http.time field gives time from request to response.
  • Statistics, TCP Stream Graphs show steady flow versus stalls.

What points where

EvidencePoints to
Fast handshake, long wait for the responsethe server or its backend
Retransmissions and duplicate ACKsloss on the path
Zero window from the serverthe server cannot consume data
Slow handshake that also shows in pinglatency or congestion on the path
Long gaps before the client's next requestthe client

Timing from the command line

Shell
curl -o /dev/null -s -w 'dns %{time_namelookup} connect %{time_connect} tls %{time_appconnect} ttfb %{time_starttransfer} total %{time_total}\n' https://app.example.com/report

The values are cumulative from the start, so connect minus DNS time is roughly one round trip.

Traps

  • Pinging the server and stopping there. ICMP tells you nothing about server think time.
How did you do?Book 5.2 Reliable Byte Stream (TCP)