AlgoViz

Locating a failure along a request path

medium 6 min

A client request crosses several separately measurable stages.

Video lesson · Chapter 1 of 4

Lookup, connect or response?

0:00 / 2:00

Theory

Read or listen first. About 1 min.

What it is

A client request crosses several separately measurable stages. Name resolution chooses an address, transport connects, TLS authenticates where applicable and HTTP exchanges bytes. A long total duration cannot tell which stage consumed the deadline. Reuse of cached answers and established connections can also make warm and cold measurements differ.

Why it exists

A checkout dependency appears slow only for newly started workers. Compare lookup time, connect time and time to first response byte from the affected workload. Established connections may mask a resolver issue. A cached query on the engineer’s laptop measures a different path. Keep the requested name, resolver and caller population stable while comparing.

If name lookup stays fast, inspect connect and TLS completion before blaming the resolver.

Lookup, connect or response?

Request client → DNS resolver (look up address). Request client → TCP listener (connect to address). TCP listener → HTTP handler (hand off request)
Request client → DNS resolver (look up address). Request client → TCP listener (connect to address). TCP listener → HTTP handler (hand off request)

Inside this chapter

Network Connections with ss and netstat
Socket inspection separates listeners from established connections and shows queue and state information. Filter to the service namespace and interval to avoid mistaking unrelated traffic for a symptom.
Packet Capture with tcpdump
For an authorized service, a bounded capture of packet timing and headers can locate a missing response. Restrict scope and avoid recording application payload when metadata answers the question.
HTTP Debugging with curl
A client timing breakdown separates lookup, connect, handshake and response. Preserve hostname and caller environment when comparing endpoints because these affect routing and identity validation.
DNS Debugging with dig and nslookup
Query the same name and record type through the affected resolver and an authoritative view. Record status, answer and remaining TTL to distinguish absence from stale caching.
Network Path Analysis with mtr
Hop sampling can reveal where end-to-end latency changes. Intermediate routers may deprioritize diagnostic replies; an isolated slow hop without downstream degradation is weak evidence.

How it works

Step through the idea, or press Play.

Step 1 of 4

Resolve the name. Record time until the client has an address from its actual resolver.

Understand it

Worked incident

Lookup, connect or response?

ObservationName lookup time (ms)Interpretation
Baseline5Cold requests resolve the name within a few milliseconds.
Incident950An unhealthy resolver adds nearly a second before the first connection attempt.
After intervention7Restore resolver reachability and repeat cold and warm requests from the same environment.
Illustrative measurements from the same workload at three checkpoints.

Choose the next investigation

If name lookup stays fast, inspect connect and TLS completion before blaming the resolver.

Summary

The whole topic in one minute.

The delay precedes connecting to the server. Application spans begin too late to observe it.

If name lookup stays fast, inspect connect and TLS completion before blaming the resolver.

Sources