HTTP

HTTP 429 Too Many Requests vs 503 Service Unavailable

Both 429 and 503 tell clients to back off and retry later, but they indicate different root causes. A 429 means the specific client has exceeded a rate limit, while a 503 means the service itself is unavailable for all clients, regardless of individual usage.

Description

The user has sent too many requests in a given time (rate limiting). The response should include a Retry-After header.

Quand vous le voyez

When hitting API rate limits or making too many requests too quickly.

Comment résoudre

Check the Retry-After header. Implement exponential backoff. Consider caching responses.

Description

The server is temporarily unable to handle the request due to maintenance or overload. Should include a Retry-After header.

Quand vous le voyez

During maintenance windows, server overload, or when the application pool is exhausted.

Comment résoudre

Wait and retry. Check the Retry-After header. Scale up servers if it's a capacity issue.

Différences clés

1.

429 is client-specific — this particular client sent too many requests within a time window.

2.

503 is service-wide — the server is unavailable for everyone due to maintenance, overload, or failure.

3.

Both should include a Retry-After header to tell the client when to try again.

4.

429 can often be resolved by the client by slowing down its request rate.

5.

503 is outside the client's control — the server needs to recover before any requests will succeed.

Quand utiliser lequel

Return 429 when a client exceeds its rate limit or quota — this signals them to implement backoff without affecting other clients. Return 503 when the entire service is down for maintenance, overloaded beyond capacity, or a critical dependency has failed. Include Retry-After with both codes.

En savoir plus