Hello,
I have 2+ servers running on one VM, and I want to only process one HTTP request at a time across all of them (they’re performing brief, mem and CPU-intensive work).
Protect Servers with HAProxy Connection Limits and Queues - HAProxy Technologies says if mode http
is set, “the maxconn
parameter on a server
line … relates to the number of concurrent HTTP requests.”
That’s close to what I need, but maxconn
in frontend
or global
seems to mean connections, not requests.
Is there some way to achieve this? Thanks-
Two configs I’ve tried:
global
maxconn 1
frontend MyFrontend1
bind 127.0.0.1:3001
default_backend rpc_1
backend rpc_1
mode http
server s1 127.0.0.1:31234
frontend MyFrontend2
bind 127.0.0.1:3002
default_backend rpc_2
backend rpc_2
mode http
server s2 127.0.0.1:31235
frontend rpc
mode http
bind :3001
bind :3002
maxconn 1
use_backend rpc_1 if { dst_port 3001 }
use_backend rpc_2 if { dst_port 3002 }
1 post - 1 participant