Quick reference
Four blocks: set the bound, cap the retry, watch the queue, prove the shed.
Timeouts
curl -m 2 -sS https://api.example/health
curl --connect-timeout 1 -m 3 https://api.example
psql -c 'set statement_timeout=2000' -c 'select 1'
nginx -T | grep -i proxy_read_timeout
grpcurl -max-time 2 host:443 pkg.Svc/MethodRetries
curl --retry 2 --retry-connrefused -sS $URL
curl --retry 5 --retry-max-time 10 -sS $URL
ssh -o ConnectTimeout=2 -o ConnectionAttempts=3 host
kubectl rollout status deploy/api --timeout=90s
systemctl show -p RestartUSec api.serviceQueues
redis-cli LLEN queue:jobs
rabbitmqctl list_queues name messages
aws sqs get-queue-attributes --queue-url $Q --attribute-names All
kubectl get hpa -n prod
systemctl status worker@1Verify
curl -s -o /dev/null -w '%{http_code}' $URL
curl -sI https://api.example/health | head -1
redis-cli info stats | grep rejected
psql -c 'show statement_timeout'
ss -sIn one line: A limit you cannot see is a limit you will discover. Run one of these against a copy before the incident picks it for you.
Check the bound:
curl -m 2 -sS -o /dev/null -w '%{http_code}' $URLExplained
Timeouts first. A curl call without a limit can wait for as long as the server feels like holding the connection. Set a total limit and a separate connect limit, and do the same at the proxy and the database session. If a limit is not visible in a config file, it is a default chosen by someone else.
Retries next. Curl can retry connection failures, but only when you ask it to, and the delay matters. A retry without a cap on total time is how a two-second page becomes a thirty-second one.
Queues third. Look at depth, age and the number of messages ready, not only the number published. A queue that is growing is a queue that will eventually reject or time out.
Verification last. Run a short load test, read the status codes and the time total, and check that the rejection path actually rejects. A shed rate you have never triggered is a hypothesis.
The honest caveat: most of these commands show one host. A timeout that behaves on your laptop can behave differently behind a proxy that rewrites it.
Your turn: Which command would you run first in an incident?
Related on this site
More notes: Reliability patterns
Open in the notes app: search, filters, copy This note on GitHub