Choosing Timeout and Retry Settings for HTTP Uptime Checks

Choosing Timeout and Retry Settings for HTTP Uptime Checks

Timeout and retry settings for HTTP uptime checks decide whether your monitoring tells the truth or just makes noise. Set the timeout too short and a slow-but-working site pages someone at 3 a.m. Set it too long, or stack too many retries, and a real outage runs for ten minutes before anyone hears about it. This article covers how to pick timeout values, how many retries to allow, and how the two settings work together so that your downtime detection is both fast and accurate.

What a Timeout Actually Measures

An HTTP uptime check moves through several phases: DNS resolution, TCP connect, TLS handshake, sending the request, and waiting for the first byte and then the full response. Most monitoring tools give you one timeout that covers all of these. Tools like curl split them into two settings, –connect-timeout for the connection phase and –max-time for the whole request.

The split matters because each phase points to a different problem. If the connection fails within 2 seconds, the cause is usually network or firewall related. If the connection opens but the response takes 25 seconds, the application is struggling, often because of database locks, an exhausted PHP-FPM pool, or a slow upstream API. Before changing any thresholds, an experienced SRE first checks which phase is actually eating the time.

Choosing a Timeout Value That Fits Your Site

Start from your own data, not a default. Pull two weeks of response time history and find the 99th percentile. If your homepage normally responds in 300-600 ms and the p99 is 1.8 seconds, a timeout of 8-10 seconds leaves plenty of headroom and still catches a hung server quickly. For most content sites and online stores, 10 seconds is a sensible starting point.

Some endpoints need a different value. A report-generation page or a search endpoint that queries a large catalog may regularly take 4-6 seconds, so 15-20 seconds is fair there. A lightweight /health endpoint should answer in under 500 ms, and a 5-second timeout on it is generous. If your health endpoint needs 5 seconds, that is a performance problem in its own right. The server response time benchmarks give useful reference points for what normal looks like.

Your infrastructure also sets hard limits. Cloudflare returns a 524 error when the origin doesn’t respond within 100 seconds. The AWS Application Load Balancer idle timeout defaults to 60 seconds, as does Nginx’s proxy_read_timeout. A monitor timeout of 120 seconds behind Cloudflare is therefore pointless, because the proxy will give up first and your check will record a 524 rather than a timeout. Keep the monitor timeout well below the shortest timeout in the chain, so you see the slowness before the proxy turns it into an error page.

The Myth: More Retries Means Fewer False Alarms, at No Cost

A common belief is that adding retries is free: just set five of them and false positives go away. Retries cost time, and that time comes straight out of your detection speed.

Here is the math. With one-minute checks, a 30-second timeout and three retries before alerting, a fully hung server can take up to 3-4 minutes to trigger an alert. Each attempt waits out the full 30 seconds, and the retries are spread across check cycles. Cut the timeout to 10 seconds and use one immediate retry, and the same outage shows up in roughly 1-2 minutes. On a store doing $2,000 an hour, those extra minutes are real money, and on a SaaS product with a 99.95% SLA, they eat through a monthly error budget of about 22 minutes very quickly.

Retries are worth having, but they only fix one kind of problem: transient blips such as a dropped packet, a single slow garbage collection pause or a brief connection reset. They do nothing for an overloaded server, which will still be overloaded 30 seconds later.

A Practical Retry Configuration, Step by Step

Picture a familiar Tuesday. A WordPress site on a mid-range VPS starts sending a downtime alert every few nights at around 02:15, and each one clears on the next check. The owner raises the timeout from 10 to 30 seconds, and the alerts stop. Three weeks later, a real outage takes six minutes to detect, because every check now waits half a minute before giving up. It turns out the nightly alerts came from a backup job saturating disk I/O, and the bigger timeout simply hid it.

A better approach works in this order:

1. Measure p50 and p99 response times per endpoint over at least 14 days.
2. Set the timeout at roughly 3-5x the p99, capped below your proxy or load balancer limit.
3. Allow one retry, ideally from a second location, before confirming downtime.
4. Alert on sustained slowness separately, for example response time above 3 seconds for 5 consecutive checks.
5. Review every alert that cleared on its own within a month and look for patterns by time of day.

Step 5 is the one people skip. Self-resolving alerts that cluster at the same hour are rarely random. They usually point to cron jobs, backups or cache rebuilds. Our guide on how to reduce false positive alerts without missing real issues covers that review process in more detail.

Common Mistakes When Tuning Timeout and Retry Settings

The most frequent mistake is raising the timeout to silence alerts. It works the way removing a smoke detector battery works. The slowness is still there, you just stop seeing it. If a check needs a 30-second timeout to stay green, users are seeing 30-second page loads.

The second is using the same settings for every endpoint. A static marketing page behind a CDN and an authenticated API call backed by three microservices behave nothing alike. One global 30-second timeout is too lax for the first and possibly too strict for the second.

The third is ignoring cold starts. On serverless platforms like AWS Lambda, Google Cloud Run or Vercel functions, the first request after an idle period can take several seconds longer. With low traffic, your monitor may be the only thing waking the function up, so every check looks slow. The fix is to understand the pattern rather than just bump the timeout. See how cold starts affect uptime for the trade-offs.

There are exceptions. Internal tools used by a 5-person team during office hours can live with slower detection and more retries, since nobody pays for a 3 a.m. page. Payment and checkout flows are the opposite case: tight timeouts, at most one retry and immediate escalation.

FAQ

What is a good default timeout for an HTTP uptime check?
For most websites, 10 seconds works well. Lower it to 5 seconds for lightweight health endpoints, and raise it to 15-20 seconds only for pages that are known to be heavy, based on measured p99 response times.

How many retries should I configure before an alert fires?
One retry, preferably from a different monitoring location, filters out most transient network issues without delaying detection much. More than two retries on one-minute checks usually slows downtime alerts more than it reduces noise.

Should a timeout count as downtime?
Yes. From a user’s point of view, a page that never loads is down, whatever the server logs say. Treat a confirmed timeout as an outage and track slowness that stays under the timeout as a separate performance alert.

Summary

Good timeout and retry settings come from measurement, not guesswork. Base the timeout on your p99 response time, keep it below every proxy limit in front of your site, and limit retries to one confirmation check so that real outages still surface within a minute or two. Monitor slowness separately from downtime. When an alert keeps clearing itself at the same hour each night, investigate the cause before you change any threshold.