HTTP 503 Service Unavailable (maintenance & overload)
The service is temporarily not taking your request — maintenance, overload, or no healthy backend. Often you should wait and retry.
What 503 is saying
5xx = server-side. 503 is the polite “closed for a bit” signal. Good operators return it deliberately during deploys or when refusing load is safer than melting the database.
HTTP/1.1 503 Service Unavailable
Retry-After: 120
Content-Type: application/json
{"error":"service_unavailable","message":"Try again in 2 minutes"}
503 vs lookalikes
| Code | Means | Who should change what |
|---|---|---|
| 503 | Unavailable / overloaded / draining | Wait; scale; finish maintenance |
| 502 | Bad gateway / upstream broken | Fix upstream process, port, TLS |
| 504 | Gateway timed out | Speed up upstream or raise aligned timeouts |
| 429 | You hit a rate limit | Slow your client; honor Retry-After |
| 500 | Unhandled server error | Bug in app code |
Some CDNs map “origin down” to 521/522/523 — same idea as unavailable, different banners.
Typical causes
- Maintenance / deploy — process stopped; LB returns 503 by design.
- No healthy backends — health checks failing; target group empty; Kubernetes endpoints blank.
- Overload — thread/worker pool full; intentionally shedding load.
- Circuit breaker open — sidecar (Envoy, app library) stops calling a failing dependency and fails fast with 503.
- Draining — instance marked unhealthy for shutdown; new traffic gets 503 while in-flight finish.
Retry-After
Same rules as 429: integer seconds or an HTTP-date. Clients should wait at least that long. If missing, use exponential backoff with jitter and a capped attempt count.
curl -sI https://example.com/api/health
# Look for HTTP/2 503 and Retry-After
Operator checklist
- Return 503 (not 500) for planned unavailability; include
Retry-Afterwhen you know the window. - Health checks should fail soft during drain so the LB stops sending new work.
- Capacity: autoscale on queue depth / p99 latency, not only CPU.
- Fail fast on broken dependencies (circuit breaker) instead of holding every worker until 504.
- Status page + synthetic checks so humans know it is you, not their Wi-Fi.
Client checklist
- Honor
Retry-After; add jitter. - Treat 503 as transient for idempotent reads; show a calm “try again shortly” UI.
- Do not spin a tight retry loop — that worsens overload.
- Distinguish 503 (server busy) from 429 (you personally are too chatty).
Kid-friendly sibling: Wirebook — when sites get tired (queues, rate limits, sharing the load).
Related
Cloudflare Error 521 · Cloudflare Error 522 · Cloudflare Error 524 · HTTP 504 Gateway Timeout · 502 Bad Gateway · HTTP 429 Too Many Requests · ETIMEDOUT · net::ERR_CONNECTION_TIMED_OUT · TypeError: Failed to fetch · Anvil HTTP status · Wirebook: when sites get tired
Questions
What does HTTP 503 Service Unavailable mean?
The server or load balancer cannot handle the request right now — maintenance, overload, draining instances, or an open circuit breaker.
What is the Retry-After header on 503?
Seconds (or a date) telling clients how long to wait before trying again. Honor it to avoid making overload worse.
Is 503 the same as 429?
No. 429 is your rate limit / quota. 503 is the service itself unavailable or overloaded for everyone (or for that pool).
How is 503 different from 502 and 504?
502 = bad upstream reply; 504 = gateway timed out waiting; 503 = deliberately or effectively unavailable.
How do I fix 503 as an operator?
Restore healthy backends, finish maintenance, scale out, fix failing health checks, and return Retry-After during planned windows.
Should I retry 503?
Yes for safe GETs, with backoff and jitter. Cap attempts and surface a clear message if it keeps failing.
Published .