Curl with timing breakdown
Shows detailed timing of DNS, connect, TLS, and transfer phases.
curl -o /dev/null -s -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nTotal: %{time_total}s\n" https://example.com
Requests to a service are slow or time out, and you need to find where the time goes. All playbooks.
Split one request into DNS, connect, TLS and total time. The slowest phase tells you where to look.
Shows detailed timing of DNS, connect, TLS, and transfer phases.
curl -o /dev/null -s -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nTotal: %{time_total}s\n" https://example.com
If DNS is slow or wrong, follow the resolution path.
Follows the DNS delegation path from root servers.
dig +trace <domain>
If connect is slow or fails, check the port is reachable.
Uses netcat to check if a remote TCP port is reachable.
nc -vz <hostname> <port>
Check whether it affects everyone, starting with p99 latency.
Calculates the 99th percentile request latency from a histogram.
histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))
Then the share of requests failing with 5xx.
Calculates the percentage of 5xx responses over the last 5 minutes.
sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) * 100
On the server, count connections by state. A pile of TIME_WAIT or SYN_RECV points at connection handling.
Groups and counts TCP connections by their state (ESTABLISHED, TIME_WAIT, etc.).
ss -tan | awk 'NR>1 {print $1}' | sort | uniq -c | sort -rn