HTTP

HTTP 429 Too Many Requests vs 522 Connection Timed Out

HTTP 429 (Too Many Requests) is a 4xx Client Error response, while 522 (Connection Timed Out) is a 5xx Server Error response. 429 indicates that the user has sent too many requests in a given time (rate limiting). The response should include a Retry-After header. In contrast, 522 means that cloudflare-specific. TCP connection to the origin server timed out.

Description

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

When You See It

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

How to Fix

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

Description

Cloudflare-specific. TCP connection to the origin server timed out.

When You See It

When the origin server is overloaded or network issues prevent connection.

How to Fix

Check origin server health. Verify firewall rules. Check for network congestion.

Key Differences

1.

429 is a 4xx Client Error response, while 522 is a 5xx Server Error response.

2.

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

3.

HTTP 522: Cloudflare-specific. TCP connection to the origin server timed out.

4.

You encounter 429 when when hitting API rate limits or making too many requests too quickly.

5.

You encounter 522 when when the origin server is overloaded or network issues prevent connection.

When to Use Which

For 429 (Too Many Requests): Check the Retry-After header. Implement exponential backoff. Consider caching responses. For 522 (Connection Timed Out): Check origin server health. Verify firewall rules. Check for network congestion.

Learn More