503 Service Unavailable
HTTP response status code 503 Service Unavailable is a server error indicating the server is temporarily unable to handle the request due to maintenance or overloading.
Usage
The 503 Service Unavailable status code means the server is unable to fulfill the HTTP request for a temporary reason. The server is overloaded with a sudden surge of traffic, the resource is locked, the server is rebooting, or a firewall misconfiguration is blocking the request.
Many sites return the 503 Service Unavailable status code during site maintenance, which is the recommended approach to ensure search rankings are not affected.
When the server is aware of the problem, such as a locked or overburdened resource, the Retry-After HTTP header informs the client when to resubmit the request.
Amazon S3 returns 503 Slow Down when request rates exceed the per-prefix throughput limits. A sudden spike beyond these thresholds triggers throttling while S3 scales partitions in the background. Distributing objects across multiple prefixes, implementing exponential backoff, and ramping up request rates gradually avoids the error. S3 does not charge for 503 responses.
Fastly returns 503 Service Unavailable with
the reason text "Loop detected" when a request
appears to route back to the same Fastly service
or has transited too many Fastly servers. Fastly
tracks request hops using the Fastly-FF and
CDN-Loop headers. A request is rejected as a
loop when the request exceeds any of these
limits: more than three prior visits to the
same POP for the same service, more than six
unique Fastly services in the request path, or
more than twenty total
hops across all services. Loops commonly occur
when the same hostname is configured as both the
domain and the backend for a service, and DNS for
the hostname resolves to Fastly. Using a
separate origin hostname (e.g.,
origin.example.re) or an IP address for the
backend avoids the loop.
SEO impact
Googlebot treats
5xx errors as a
signal to temporarily reduce the crawl rate
across the site. Previously indexed URLs are
preserved initially, but extended downtime
causes Google to drop them from the index. Any
content returned with a 503 response is
ignored. Google treats 500, 502, and
503 identically. 503 has no special
advantage over other
5xx codes for
planned maintenance despite common advice
suggesting otherwise. A
5xx error on the
robots.txt file is far more severe, even
when every other page on the site returns
200. Google halts crawling for up to 12
hours, then falls back to a cached copy for up
to 30 days. If the error persists, Google
fully deindexes the site. Bingbot respects
Retry-After on 503 responses
for scheduling return visits. Persistent 503
responses prevent indexing in Bing.
Example
The client requests a resource and the server responds with a 503 Service Unavailable because the resource is temporarily unavailable. The Retry-After header suggests resubmitting the request after 30 minutes.
Request
GET /latest_quotes HTTP/1.1
Host: www.example.re
Response
HTTP/1.1 503 Service Unavailable
Content-Type: text/html; charset=UTF-8
Content-Length: 124
Retry-After: 1800
<html>
<head>
<title>Resource Busy</title>
</head>
<body>
<p>Try again after 30 minutes.</p>
</body>
</html>
How to fix
Determine whether the 503 is intentional (maintenance mode) or unplanned (overload, crash). An intentional 503 paired with a Retry-After header requires no debugging, only waiting for maintenance to finish.
For unplanned 503 errors, check these common causes:
Server resource exhaustion. Run
top,htop, orvmstaton the server. High CPU or memory usage means the server lacks capacity. In Apache, the error log shows "server reached MaxRequestWorkers setting" when all worker slots are occupied. RaiseMaxRequestWorkers(andServerLimitfor prefork MPM) in the Apache configuration. In nginx, increaseworker_connectionsin theeventsblock.Application pool crash. PHP-FPM, Gunicorn, or a similar process manager exiting under load leaves the web server with no backend to serve requests. Check process manager logs, then increase pool size (
pm.max_childrenin PHP-FPM,--workersin Gunicorn).Connection pool exhaustion. Database or external API connection pools running dry force the application to reject new requests. Increase pool size in the application configuration and confirm connections are properly released after use.
Rate limiting. Nginx
limit_reqandlimit_connmodules return 503 (or a custom status) when thresholds are exceeded. Reviewlimit_req_zoneandlimit_conn_zonedirectives. Raise burst values or addnodelayto absorb traffic spikes.Load balancer health check failure. A failing health check pulls the server from rotation. In AWS ALB/NLB, check target health in the console. In nginx
upstreamblocks, reviewmax_failsandfail_timeoutsettings.Deployment-triggered restart. Rolling deployments with too few instances cause brief 503 windows. Increase minimum healthy instances or use blue-green deployments.
AWS S3 throttling (503 Slow Down). S3 throttles requests exceeding the per-prefix request rate limits. Distribute objects across multiple prefixes using randomized key prefixes (e.g.
hex-hash/original-key). Implement exponential backoff starting at 1 second. Ramp up request rates gradually instead of sending burst traffic. The AWS SDK retries 503 SlowDown responses automatically with backoff when properly configured.
For traffic spikes, add a CDN or Caching layer to offload static requests. Set up monitoring and alerting on 503 rates so resource constraints surface before a full outage.
Code references
.NET
HttpStatusCode.ServiceUnavailable
Rust
http::StatusCode::SERVICE_UNAVAILABLE
Rails
:service_unavailable
Go
http.StatusServiceUnavailable
Symfony
Response::HTTP_SERVICE_UNAVAILABLE
Python3.5+
http.HTTPStatus.SERVICE_UNAVAILABLE
Java
java.net.HttpURLConnection.HTTP_UNAVAILABLE
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_SERVICE_UNAVAILABLE
Angular
@angular/common/http/HttpStatusCode.ServiceUnavailable
Takeaway
The 503 Service Unavailable status code is a server error returned when an HTTP request fails due to a temporarily unavailable resource.
See also
- RFC 9110: HTTP Semantics
- Google: HTTP status codes and network errors
- Retry-After
- 500 Internal Server Error
- 502 Bad Gateway
- 504 Gateway Timeout
- HTTP status codes