Measure Where a Website Loses Time

Use curl's -w timing variables to break a page load into DNS, connection, TLS and server-response phases.

macOScurlnetworkDiagnosticsLow risk
Run the -w timing command above: the largest of the five numbers is the phase to blame — a big dns value means DNS, a big firstbyte means the server is slow.

01Command

Command
$ curl -L -o /dev/null -s -w 'dns:%{time_namelookup}s connect:%{time_connect}s tls:%{time_appconnect}s firstbyte:%{time_starttransfer}s total:%{time_total}s\n' https://example.com

02What it does

Each variable measures a phase boundary: time_namelookup is DNS resolution, time_connect is the TCP handshake, time_appconnect adds the TLS handshake, time_starttransfer adds the server thinking time before the first byte, and time_total is everything. Whichever phase contributes the biggest jump is your bottleneck — huge DNS time suggests a resolver problem, high time_starttransfer means the server itself is slow to answer. The page body is discarded to /dev/null, so the test measures timing only, not download size.

03Risk

RiskLow risk
!Warning: A single measurement can be noisy; run it a few times before drawing conclusions.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: Network

06Related solutions