7

I am working on an HTTP server which is supposed to only allow a certain amount of connections per user. How do I gracefully tell the user that more than n connections are not permitted. I tried answering the n+1th request with a 403 but apparently that kills the whole download. (At least with DownThemAll!)

niklasfi
  • 459
  • 1
  • 8
  • 16

2 Answers2

10

429: Too Many Requests

seems to be the one.

niklasfi
  • 459
  • 1
  • 8
  • 16
  • 3
    Not sure. 429 is intended for use with rate-limiting schemes. Typically a max nb of requests per time interval, per user, per resource, etc. Max number of *concurrent* requests may be a different thing. (I'm still looking for a better answer so I might go for 429 anyway.) – Jérôme Oct 02 '18 at 08:12
4

If the user is exceeding a user specific cap, then 429 "Too Many Requests".

But, if the user is within their individual cap (or none exists), but the server is buckling under the aggregate across all users 509 "Bandwidth Limit Exceeded" (this one is common convention, but not defined this way by an RFC).

The difference is that in the first case we have a naughty client, so 4xx series error. In the latter case, the server oversubscribed its capacity and admits defeat, so 5xx series error.

bwtaylor
  • 141
  • 1