On Sun, Jan 30, 2022 at 09:18:00AM +0100, Orlando Della Casa wrote: > I'd like to put a rate limit on incoming HTTP requests, but without sending > 429 errors. Instead, requests beyond the limit should be put into a queue > from which they are processed at a speed that respects the rate limit. It's > important that such a queue be per-client, so that clients don't affect > each other. Is this possible with HAproxy?
It's not currently possible within a single proxy, it has remained in the todo-list for over a decade, likely an indicator that there's little such demand. There's a trick to do something closer to that by chaining two proxies, though: there's such a rate limiting on the accept() side (for new connections), so by chaining two proxies in HTTP close mode, once the second refuses to accept new connections, the first one will start to queue. The only thing is that you'll need one second level proxy per client that you want to individually rate-limit. If that's just a few, that might work for you, but if they are numerous it will probably not suit your needs. Willy

