Hi,

I have a TCP network instrument which only allows a limited number of
connections (3).

I would like to use HAProxy to limit the maximum number of clients but I
would like to have a semantic of: *close the oldest client if maxconn is
reached*. I there a way to configure HAProxy to handle connections like
this?

My clients already handle reconnection automatically so if maxconn + 1
clients are active and HAProxy is able to close the oldest client I could
connect as many clients as I want transparently.

I know that having a lot of active clients could lead to flooding the
network reconnection requests but I prepared to handle the risk since my
use case is very isolated.

Here is my current HAProxy config:

defaults
    mode tcp
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms

listen wago1
    bind :15001
    server wago1 wago1:502 maxconn 3


Thanks in advance

Kind regards,
Tiago

Reply via email to