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+1
th request with a 403 but apparently that kills the whole download. (At least with DownThemAll!)
Asked
Active
Viewed 8,879 times
7

niklasfi
- 459
- 1
- 8
- 16
2 Answers
10
-
3Not 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
-
What about 503 Unavailable? Another answer under this question points out 503 can indicate overloadedness. – 把友情留在无盐 Dec 02 '16 at 09:08
-
Besides, the idea of discriminating server limit from client limit is real good. – 把友情留在无盐 Dec 02 '16 at 09:08