HTTP status code for overloaded server

10,582

Solution 1

503 means the service is temporarily unavailable so it is appropriate to use while the server is overloaded. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

The Wikipedia article defines 269 as the initial response for a request that must be processed asynchronously. 269 means the request added something to the server's "queue" of things to do and the server will have a response available as soon as possible, whereas 503 means the server will not "remember" the request.

I've never heard of 269, though, and the first Google result for it is this question, followed by the Wikipedia article.

Solution 2

Another option is a 429 - Too Many Requests response.

Defined in RFC6585 - https://www.rfc-editor.org/rfc/rfc6585#section-4

The spec does not define how the origin server identifies the user, nor how it counts requests.

For example, an origin server that is limiting request rates can do so based upon counts of requests on a per-resource basis, across the entire server, or even among a set of servers.

Likewise, it might identify the user by its authentication credentials, or a stateful cookie.

Also see the Retry-After header in the response.

Share:
10,582
trante
Author by

trante

Updated on June 06, 2022

Comments

  • trante
    trante about 2 years

    Some hours my web site's server has too much load.
    Which HTTP status code should I send to the Googlebot that visits my website?

    Is "269 Call Back Later" this suitable for this case, or 503 Service Unavailable or do you have any more suggestions?

  • Aleksandr Dubinsky
    Aleksandr Dubinsky about 11 years
    It must be a joke in the standard. Client asks "to 69?" The server, having fulfilled the request, responds: "call back later!" Client thinks "yeah, sure, I'll call you."
  • McKay
    McKay over 2 years
    429 is appropriate when a user is making too many requests. If the server is overloaded because of more than one user, it should not be returned. 4xx codes are for when the user isn't playing by the rules. 5xx should mean it's something the user isn't responsible for.
  • Ben Walding
    Ben Walding over 2 years
    That's not what the RFC says though: Note that this specification does not define how the origin server identifies the user, nor how it counts requests. For example, an origin server that is limiting request rates can do so based upon counts of requests on a per-resource basis, across the entire server, or even among a set of servers.
  • McKay
    McKay over 2 years
    But you're missing the bigger picture. "10.4 Client Error 4xx The 4xx class of status code is intended for cases in which the client seems to have erred." I mean sure you can do whatever you want, but the explicit "intent" is for 4xx errors is to be used for when the client has apparently made a mistake. What you're describing is against that intent.
  • user3399101
    user3399101 over 2 years
    That 269 code has been removed from Wikipedia since then confirming it was not a real definition.