503 503 Service Unavailable
The server is temporarily unable to handle the request, typically due to maintenance or overload.
What Is This?
The HTTP 503 Service Unavailable status code indicates that the server is temporarily unable to handle the request. This is typically a temporary condition that may be resolved after some delay. Common causes include server overload from traffic spikes, scheduled maintenance, or rate limiting at the infrastructure level. Unlike 500 (unexpected error), 503 is usually expected and planned for.
Common Causes & Solutions
Common Cause
Server overload from unexpected traffic spikes
Common Cause
Scheduled maintenance or deployment in progress
Common Cause
Application server restarting or scaling up
Common Cause
Database connection pool exhausted
Implement health check endpoints
Create a /health endpoint that checks all dependencies (DB, cache, external APIs) and returns the server status.
// Express.js health check endpoint
app.get('/health', async (req, res) => {
const health = {
status: 'ok',
timestamp: new Date().toISOString(),
uptime: process.uptime()
}
try {
await db.raw('SELECT 1')
health.database = 'connected'
} catch (err) {
health.database = 'disconnected'
health.status = 'degraded'
}
res.status(health.status === 'ok' ? 200 : 503).json(health)
})Use Retry-After header
Include Retry-After in 503 responses to tell clients when to retry, reducing thundering herd problems.
HTTP/1.1 503 Service Unavailable
Retry-After: 120
Content-Type: application/json
{
"error": "Service Unavailable",
"message": "The server is undergoing maintenance. Please try again in 2 minutes."
}Related Entries
More from this reference:
500 500 Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request.
502 502 Bad Gateway
The server acting as a gateway received an invalid response from an upstream server.
504 504 Gateway Timeout
The server acting as a gateway did not receive a timely response from an upstream server.
Frequently Asked Questions
How long should a service stay unavailable?
503 is for temporary conditions — seconds to hours. If a service will be down for more than a day, consider serving a static maintenance page with a 503 status and a clear explanation.
Does 503 affect SEO?
Yes, if a page consistently returns 503, search engines may assume it is permanently unavailable. Use 503 only for genuine temporary outages. For permanent pages, use appropriate redirects or remove the URL from sitemaps.