503 Service Unavailable
The server is temporarily unable to handle the request due to overload or maintenance, and the condition is expected to be temporary.
Defined in RFC 9110 §15.6.4
What 503 means
HTTP 503 Service Unavailable tells the client that the server is currently unable to handle the request, but that the condition is expected to be temporary rather than permanent. RFC 9110 explicitly ties 503 to the server's capacity or maintenance state, not to anything wrong with the request itself, and recommends the server include a Retry-After header telling the client when to try again, either as a number of seconds or an HTTP date. Unlike 500, which signals an actual fault, a well-formed 503 is often a deliberate, controlled response the server chose to send rather than a symptom of something broken.
Planned maintenance is one of the cleanest uses of 503: many frameworks and CMS platforms, such as WordPress, Rails, and Laravel, ship a maintenance-mode flag that, when enabled, makes every request return 503 with a Retry-After header while a deployment or database migration runs, then automatically clears once the flag is removed. This is preferable to letting requests hit a half-migrated database or a server mid-restart, because it tells clients and search engines explicitly that the outage is intentional and temporary rather than leaving them to infer that from a timeout or a 500.
The other major source of 503s is overload: too many concurrent requests for the available application workers, database connection pool exhaustion, or a load balancer that has no healthy backend to route to because every instance failed its health check at once. Autoscaling groups can make this worse during a traffic spike if new instances take longer to boot and pass health checks than the traffic takes to arrive, producing a wave of 503s until capacity catches up; this is why readiness probes, connection queuing, and gradual traffic ramp-up matter as much as raw instance count.
503 also has a specific meaning for search engines that 500 does not: Google's documentation states that Googlebot treats a 503, ideally with Retry-After, as a signal to come back later without dropping the page from the index, whereas a prolonged run of 500s or an unclear error can eventually be interpreted as the page being gone. This makes 503 the correct status for planned maintenance windows on public sites, since it protects search rankings, but only if it is removed once the site is back; a site accidentally stuck serving 503 for days can still lose ranking despite the status code's intent.
Common causes
- The application is deliberately in maintenance mode, returning 503 for every request during a deployment or database migration.
- The server is overloaded: too many concurrent requests exceed the available worker processes, threads, or database connection pool.
- A load balancer has no healthy backend to route to because every instance is failing its health check simultaneously.
- An autoscaling group has not yet provisioned enough capacity to absorb a sudden traffic spike, so new requests queue and time out.
- A dependency the application needs to start up, such as a database or cache, is itself unreachable, so the app reports itself unready.
- Rate limiting or circuit-breaker logic is intentionally shedding load to protect the system from cascading failure.
How to fix a 503
If you are the client (browser user or API caller)
- Honor the Retry-After header if present, and wait that long before retrying instead of retrying immediately.
- Use exponential backoff with jitter for automated retries so many clients do not all retry at the exact same moment and re-trigger the overload.
- Surface a friendly temporary-unavailable message to end users rather than a raw error, since 503 is often expected and short-lived.
- For scheduled maintenance windows announced in advance, queue non-urgent requests client-side rather than hammering the endpoint during the outage.
- If 503s persist well past any expected maintenance window, treat it as an actual incident and check the provider's status page.
If you run the server
- Always include a Retry-After header with maintenance-mode 503 responses so clients and search engines know roughly when to return.
- Scale application workers, database connection pools, or instance count ahead of known traffic spikes rather than reactively after 503s start.
- Tune autoscaling policies so new instances pass health checks and start receiving traffic before demand outpaces existing capacity, using predictive or scheduled scaling for known spikes.
- Use circuit breakers and request queuing to shed load gracefully with 503 instead of letting the whole system slow to a crawl or crash outright.
- Ensure maintenance mode is time-bounded and monitored, and confirm it is disabled promptly after the work is done so the site is not stuck 503 for search engines.
Example
GET / HTTP/1.1
Host: example.com
HTTP/1.1 503 Service Unavailable
Retry-After: 120
Content-Type: text/html
<html><body><h1>We'll be back shortly</h1>
<p>Scheduled maintenance is in progress. Please check back in a couple of minutes.</p>
</body></html>Try it live
Our free status responder returns a real HTTP 503 you can point tests, monitors or a browser at.
GET https://mcp.httpstatus.com/status/503