Back to HTTP Status Codes

503 Service Unavailable 5xx

The server is temporarily unable to handle requests, often due to overload or maintenance.

What does 503 mean?

A 503 Service Unavailable response means the server is currently unable to handle the request — but, importantly, this is framed as a temporary condition, often a deliberate one. Common reasons include the server being overloaded, undergoing maintenance, or waiting on a dependency that's currently down.

The key distinction from 500: a 500 typically represents an unexpected failure (a bug, an unhandled exception), while a 503 often represents an expected, sometimes intentional, state — "we know we're not available right now, and here's roughly when we will be."

How a 503 behaves

  • It can include a Retry-After header, just like 429 — telling the client how long to wait before trying again, either in seconds or as a date
  • It's not cacheable by default — the unavailability is temporary, so caching the error would mean continuing to serve it after the server recovers
  • It's the standard code for planned maintenance windows — sites doing scheduled downtime should return 503 (with Retry-After) rather than just timing out or returning a generic error
  • Search engines treat it as "come back later" — unlike a 500 (ambiguous) or a 404 (gone), a 503 with a reasonable Retry-After is a clear, well-understood signal

Common causes

If you're building the API or website:

  • You're deliberately taking the application offline for deployment or maintenance and returning 503 during that window
  • The application server pool is overloaded — too many concurrent requests for available worker processes/threads
  • A critical dependency (database, cache, queue) is down, and your application correctly detects this and fails fast with 503 rather than hanging or returning a confusing 500
  • Auto-scaling hasn't caught up with a traffic spike yet, and the load balancer is returning 503 for requests it can't route to a healthy backend

If you're calling an API:

  • The API provider is undergoing scheduled maintenance — check their status page
  • The API is experiencing an outage or degraded performance affecting all clients, not just you (a useful distinguishing factor from 429, which is client-specific)
  • You're hitting the API during a deploy or infrastructure change on their end

If you're a website visitor:

  • The site is down for maintenance — well-built maintenance pages explicitly say so
  • The site is experiencing unusually high traffic (a "hug of death" from going viral, a flash sale, etc.)
  • A temporary infrastructure issue on the site's hosting provider or CDN

How to fix it

As an API/website builder:

  • For planned maintenance, return 503 with a Retry-After header set to your expected downtime duration — this is the textbook-correct use of this code
  • Implement graceful degradation — if a non-critical dependency is down, consider serving a reduced-functionality response rather than a full 503, reserving 503 for when the core service truly can't function
  • Monitor for 503s caused by capacity issues — frequent 503s during traffic spikes may indicate you need to scale infrastructure or add rate limiting (429) further upstream to shed load gracefully
  • Don't leave a 503 maintenance page up indefinitely — prolonged 503s can eventually cause search engines to treat the unavailability as more permanent and start removing pages from the index

As an API consumer:

  • Treat 503 similarly to 429 — back off and retry later, respecting Retry-After if present
  • Check the API provider's status page before assuming the issue is on your end
  • For critical integrations, consider implementing a circuit breaker pattern — after repeated 503s, stop sending requests for a cooldown period rather than continuing to hammer a struggling service

As a website visitor:

  • Wait and try again later — 503 explicitly signals "temporary"
  • Check the site's social media or status page for outage announcements
  • If the 503 persists for an unusually long time, it may indicate a bigger problem the site owner isn't actively communicating

503 vs related codes

Code Meaning Key difference from 503
500 Internal Server Error Unhandled application error 500 is usually an unexpected bug; 503 is often an expected, sometimes deliberate, temporary state
502 Bad Gateway Upstream server returned an invalid response 502 is about a broken handoff between servers; 503 is about the server (or the whole system) not being ready to handle requests at all
504 Gateway Timeout Upstream server didn't respond in time 504 is specifically about timing; 503 doesn't necessarily involve a timeout — the server can respond immediately with "I'm unavailable"
429 Too Many Requests This specific client is being rate limited 429 is per-client; 503 typically applies to everyone, regardless of how many requests any individual client has sent

Real-world examples

Many major platforms display a 503 with a friendly maintenance message during planned upgrades — this is considered best practice precisely because it's explicit, expected, and includes timing information via Retry-After. During extreme traffic events (major product launches, ticket sales for popular events), it's common for sites to return 503 to a portion of users as a deliberate load-shedding measure — better to tell some users "try again shortly" than to let the entire system degrade for everyone.

SEO implications

A 503 is actually the recommended status code for temporary site-wide outages from an SEO perspective — search engines generally understand a 503 (especially with Retry-After) as "don't worry, come back soon," and won't aggressively remove pages from the index during a short outage. The risk is using 503 (or accidentally leaving it active) for an extended period — if a 503 persists for days, search engines may eventually start treating the unavailability as more permanent, similar to how prolonged 500s are handled, potentially leading to temporary deindexing.

FAQ

What's the difference between 500 and 503?

500 generally indicates an unexpected error — a bug or unhandled exception in application code. 503 indicates the server is deliberately or temporarily unable to handle requests at all, often due to maintenance, overload, or a critical dependency being down — and it's frequently a more "expected" state than a 500.

Is 503 good or bad for SEO?

For short-term, well-communicated outages, 503 is actually the correct and SEO-friendly choice — it tells search engines the issue is temporary. It only becomes a problem if it persists for an extended period without resolution.

Should I use 503 for scheduled maintenance?

Yes — this is the textbook use case. Return 503 with a Retry-After header indicating roughly how long the maintenance will last, ideally alongside a user-friendly maintenance page explaining the situation.

Can 503 be returned for just one part of a site, or only site-wide?

It can be either. While 503 is often associated with full site outages, it's equally valid for a specific endpoint or feature that's temporarily unavailable (e.g., a search feature that's down for reindexing) while the rest of the site functions normally.

How long can a 503 stay up before it hurts SEO?

There's no universally agreed-upon exact threshold, but the general guidance is that a 503 should represent genuinely temporary unavailability — hours to at most a couple of days for planned maintenance. If a 503 persists for an extended period, search engines may start treating it less as "temporarily unavailable" and more as a sign the content is gone, similar to prolonged 500 errors.

Fun fact

503 is one of the few error codes that's genuinely considered "good" to return under the right circumstances — while most status codes in the 4xx/5xx range represent something going wrong that should ideally be avoided, a well-implemented 503 during planned maintenance is often held up as an example of doing error handling correctly, precisely because it communicates clearly to both users and search engines.

Related Status Codes