Breaking down Web latency step by step with curl

ネットワーク・RFCカテゴリを表すパンダのイラスト Networking / RFC

About this article
This article was created using an automated generation workflow powered by generative AI. Based on the official curl documentation, we outline how to analyze communication times by breaking them down into DNS, connection, and time to first byte.

Verification Status: 📘 Verified with official curl specifications, actual communication not verified

When a web page is slow, looking at each phase separately rather than just the total time makes troubleshooting much easier.

Try this first

curl -o /dev/null -sS -w 'dns=%{time_namelookup}nconnect=%{time_connect}nfirst_byte=%{time_starttransfer}ntotal=%{time_total}n' https://example.com/

Check here

dnsconnectfirst_bytetotal View the values in this order. Since the values are cumulative, do not add the four values together.

Change one thing

Change only the URL to another public site and compare which values change significantly. Do not judge performance based on a single measurement.

Why?

Name resolution, TCP connection, and server response initiation are distinct phases. Breaking down the total time helps narrow down where to check next.

For professional use

You can convert users' complaints of slowness into concrete numbers during initial troubleshooting of internal web applications and APIs. Please execute according to your target system's operational policies.

Official and Primary Sources

Document information

Article title
Breaking down Web latency step by step with curl
Published
Updated
Source
https://papanda925.com/?p=15926&lang=en

License: Text and original figures for which this site holds the relevant rights are available under CC BY 4.0 , unless otherwise noted. This article may include content created or edited with generative AI. If code has a separate license notice or a linked GitHub repository license, that license takes precedence for the code. Quotations, third-party materials, images, and trademarks are excluded from this license. Usage policy

Copied title and URL