Thank you very much for your response.

It's interesting to learn that round-robin is considered a non-deterministic 
algorithm. We assumed it was deterministic because of its definition that 
requests are sent to the next backend/server one after the other. During our 
experiments with HAProxy 2.8.14, we could observe that this option has an 
impact on the load balancing.

Is it possible to improve the HAProxy documentation by clarifying which 
algorithms are deterministic and which are not?

We have a further question regarding the http-keep-alive 
(https://www.haproxy.com/documentation/haproxy-configuration-manual/2-8r1/#4.2-option%20http-keep-alive)
 property. The documentation states it's enabled by default. If the client 
sends a request with the "Connection: Close" header, will HAProxy close the 
connection to the backend or keep it idle?

Best regards,
Tamara

From: Valentine Krasnobaeva <vkrasnoba...@haproxy.com>
Date: Tuesday, 10. June 2025 at 14:32
To: haproxy@formilux.org <haproxy@formilux.org>, Boehm, Tamara 
<tamara.bo...@sap.com>
Subject: Re: prefer-last-server with round robin lb algo
You don't often get email from vkrasnoba...@haproxy.com. Learn why this is 
important<https://aka.ms/LearnAboutSenderIdentification>

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" is mainly 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