Hi

I have an existing service that uses an old internal custom proxy service that 
I'd like to replace with haproxy. The old system uses http1.1 style keepalive 
requests and generally has a large number of long term frontend connections 
(e.g. 1000 or so), but requests are relatively slow (say 1 per second per 
connection), and so are able to be sent to a relatively small number of backend 
connections (20 or so on average) because each request is processed in 10's 
milliseconds or so.

Although old, the internal custom proxy has one feature that is quite nice. It 
can limit the global rate that it will open new _backend_ connections (not 
requests) to a configurable value (e.g. max 5 new backend connections 
per-second). When all backends are in use, any excess requests are queued in 
the proxy service until a backend becomes available, whether that's because an 
existing request on an existing connection completed, or enough time has passed 
to open a new backend connection.

This process is quite nice for two reasons:
1. It stops a sudden and large spike of incoming requests from causing a sudden 
spike of new backend connections
2. It stops a an unexpected slow down in backend processing from also causing a 
sudden spike of new backend connections

Given the backend service is a forking service, a sudden large spike of new 
backend connections would cause a sudden large number of forks, which can then 
generate a load spike, unexpected memory pressure, etc.

By limiting the global rate of new backend connections, we create some back 
pressure which helps reduce the chance of a spike in frontend requests causing 
cascading problems.

Looking at the haproxy docs, I'm basically looking at `rate-limit sessions`, 
but rather than only for frontends, I want to be able to control that for 
backends as well. I've looked through the documentation quite a bit, but I 
can't see anything obvious that allows this to be controlled.

Is there some option that would allow this that I'm missing?

Thanks

Rob Mueller
r...@fastmail.com

Reply via email to