HAProxy community

Leastconn algorithm for short lived connections


#1

Hi all,

We have configured HA Proxy for forwarding connections to two application servers.

We have used roundrobin algorithm for the balance parameter in the backend code section.

We wish to know if we can use leastconn algorithm for this purpose.

The connections are of a short duration and we are aware that leastconn is generally used for long running sessions.

Can we replace roundrobin with leastconn in our config file? What kind of behaviour can we expect if we were to implement this?


#2

Sure you can, just do it and monitor the numbers closely after the modification.

Usually you don’t need leastconn for short lived connections, but if you want, you can certainly use it.


#3

Thanks Lukas!