Hello. I need to limit the number of simultaneous HTTP requests PER CLIENT (e.g. no more than 5 HTTP requests in progress per client); but DO NOT REJECT exceeded request, just enqueue them until the current number of concurrent requests from this client drops below 5.
So, assume I run ab -n 1000 -c 10. I want to receive NO 503 errors at all in this command. The exceeding connections should be enqueued and will be processed sooner or later. No reject for suspicious guys, just enqueue their requests. It would be transparent for them, and they will think that the service is just slowed down. THE QUESTION IS: how to do it with haproxy (if possible at all)? I've dug in the docs and saw "tcp-request content" & "WAIT_END", but looks like they are inappropriate for my case, because "ACL-based rules are evaluated every time the request contents are updated". In my situation, I suspect the ACLs need to be recalculated each time a neighbor request from the same client is terminated (when a request terminates, it gives an enqueued request from the same client a chance to proceed). So one requests needs to "unfreeze" another one possibly. Or maybe my idea of "per-client non-rejecting enqueueing request limiting" is not good in practice, and I should switch to a more traditional limiting scheme? What do you think?