As a website owner, you’ll run into an error message from time to time. Some of these errors will be relatively simple to solve, while others will be difficult. Take the HTTP Error 429 for example.

Image Source

Troubleshooting this error is difficult because it provides few details. You know something’s wrong and you need to fix it — but you’re not exactly sure what happened or why.

To make sure you understand and can fix this problem, we’ll go over what the 429 error means and what its most common solutions are.

Download Now: Free Intro Guide to HTML & CSS

A 429 response is not technically an error — it’s a response from a server, application programming interface (API), or plugin that tells the client application to stop sending requests because they simply don’t have enough resources to accept it at this time. The client application usually refers to a website or app, but can also refer to individual users like the site admin or a site visitor or hacker.

For example, if a user is trying to access a page on your website too often in a short period of time, your server may send a 429 error. In the case of a brute-force login attempt, in which a hacker repeatedly tries to log into your site, the rate limit is an important security measure. But the rate limit will also kick in if your website is using up too many resources on a shared hosting server or service. If, for example, more than 50 requests are received from an IP address within one minute, PayPal Sandbox will block that IP for the next five minutes.

While the 429 response may seem punitive, it’s actually a protective measure against users intentionally or accidentally abusing server resources (or an API, plugin, or another service). It’s designed to prevent a backup or overflow of requests that would strain a server, or other service, that is meant to be shared and consumed by many websites and apps. So by controlling the number and timing of requests, rate limits prevent problems before they arise.

If you are seeing the HTTP 429 error on your site for other reasons, you may need to reduce the server requests or API calls you’re making. The steps discussed below are general fixes for the 429 Too Many Requests Error. If you have a WordPress site, then you may need WordPress-specific solutions.

Most of the steps below focus on avoiding, rather than retroactively fixing, an HTTP 429 error. Take a look.

1. Wait to send another request.

The simplest way to fix an HTTP 429 error is to wait to send another request. Often, this status code is sent with a “Retry-after” header that specifies a period of time to wait before sending another request. It may specify only a few seconds or minutes.

Here’s an example that asks the client to wait an hour before sending another request.

 
HTTP/1.1 429 Too Many Requests

Content-Type: text/html

Retry-After: 3600

<html>

  <head>

    <title>Too Many Requests</title>

  </head>

  <body>

    <h1>Too Many Requests</h1>

    <p>Only 100 requests per hour per logged in user is allowed on this website. Try again soon.</p>

  </body>

</html>

2. Implement exponential backoff.

If a “Retry-after” header is not sent and you don’t know how long to wait before trying, you should implement retries with exponential backoff. Using this approach, your application will not immediately repeat a failed request; instead, it will perform a series of retries with progressively longer wait times between each attempt. When the request is finally accepted, then you will know what wait time or rate is acceptable.

You can add code to implement this approach, or you can use a tool like Celery that comes with a built-in exponential backoff feature.

Celery comes with built-in exponential backoff feature for fixing the HTTP 429 error

Image Source

3. Set your own throttling limit.

Throttling is the process of limiting the number of requests an application can submit in a given amount of time. If this limit is exceeded, the server or API requests will typically be dropped or fulfilled with cached data.

While this approach is most often used by third-party APIs or platforms to prevent client apps from exceeding their limits, it can also be useful for restricting your own consumption of third-party APIs or server resources. In fact, you can implement a stricter throttling limit for yourself to prevent going over the limits of a server, API, or other service you’re using. This is an especially good idea if you’re using a costly API, like the Twitter API, and don’t want to exceed your usage policy.

4. Contact your hosting provider.

Contacting your hosting provider is always an option for any error on your website, but it should be one of the last options you try.

If you’ve tried the steps above and are still seeing the 429 error, it’s possible that the cause originated from your server and not your website. It’s also possible that your host blocks requests from specific third-party services or platforms, like Google Search Console, which makes lots of requests to websites. By reaching out to your provider, they may be able to solve the issue or provide valuable insight.

Resolving the HTTP 429 Error

An HTTP 429 Error is common, but can be avoided by paying attention to rate limits set by your server, API, plugin, or more. If you exceed those limits, there are steps you can take to resolve a 429 error. By doing so, you’ll continue to provide visitors with seamless user experiences on your site.

New Call-to-action

 css introduction

Originally published Dec 9, 2020 7:00:00 AM, updated December 09 2020