Hi Tamara!

Thanks for reporting this.

Non, round-robin is not deterministic, thus compatible with prefer-last-server and this option should not be ignored.

With which version are you observing this behaviour?

"prefer-last-server" ismainly used for keepalive with servers as the doc states and I see, that you are also using "option srvtcpka".

If you do tests with some external clients in parallel, make sure that these clients do not close its connections with haproxy between sending requests.


Could you provide your configuration, if possible + could you describe in which conditions you are observing this ?


As for doc, this info about load balancing alogorithms will be added explicitly.

In general, all supported algorithms, where hashing is envolved are deterministic.


Kind regards,


On 03/06/2025 14:39, Boehm, Tamara wrote:

Dear community,

We are using round-robin in HAProxy as a load-balancing algorithm. In our backend config, we use prefer-last-server as an option. But according to the documentation (https://www.haproxy.com/documentation/haproxy-configuration-manual/latest/#4.2-option%20prefer-last-server), the option is only applied when the load balancing algorithm in use is not deterministic. We could not find any examples in the documentation of what load balancing algorithms HAProxy considers as deterministic. According to our understanding, the round robin algorithm is a deterministic one. Can you confirm whether our understanding is correct that this option prefer-last-server is fully ignored in our case?

Our config looks like:

backend http-routers-http1

mode http

balance roundrobin

option srvtcpka

no option http-server-close

option prefer-last-server

Thanks a lot and best regards,

Tamara

--
Bien cordialement,
Valentine

Reply via email to