I confirm that as long as the number of server and each server's weight is the same, two HAProxy instances would have the same result for a source hash.
So, in case of HAProxy instance failover, the affinity remains. Baptiste On Wed, Apr 3, 2013 at 5:45 PM, Jeff Zellner <[email protected]> wrote: > I believe so, but perhaps someone with better knowledge of the code can > confirm. > > On Wed, Apr 3, 2013 at 11:41 AM, Jim Gronowski <[email protected]> > wrote: > > Thank you very much, Jeff. One follow-up: Is the hashing algorithm > > consistent across multiple instances of HAproxy? If you and I set up > > identical configurations (in different locations), and the same IP > > connected to both, would they be routed in the same way? > > > > > > > > -----Original Message----- > > From: Jeff Zellner [mailto:[email protected]] > > Sent: Tuesday, April 02, 2013 17:58 > > To: Jim Gronowski > > Cc: [email protected] > > Subject: Re: balance source and weighted records > > > > Hey Jim, > > > > Here's the pertinent section from the docs > > (http://cbonte.github.com/haproxy-dconv/configuration-1.4.html#4-balance > > ) > > > > "The source IP address is hashed and divided by the total > > weight of the running servers to designate which server > > will > > receive the request. This ensures that the same client IP > > address will always reach the same server as long as no > > server goes down or up. If the hash result changes due to > > the > > number of running servers changing, many clients will be > > directed to a different server." > > > > Cheers! > > > > -Jeff > > > > > > > > On Tue, Apr 2, 2013 at 4:04 PM, Jim Gronowski <[email protected]> > > wrote: > >> > >> Can someone provide some insight into what's happening when balancing > >> based on source? Is it consistent across different haproxy instances? > >> > >> For example, in a simple setup with one frontend balancing between two > > > >> backends, A and B - does balance source send 0.0.0.0-127.255.255.255 > >> to backend A and 128.0.0.0-255.255.255.255 to backend B? > >> > >> How does backend weight affect the distribution - does it just move > >> the proportion up or down? > >> > >> Thanks, > >> > >> Jim > >> > >> > >> > >> > >> > >> Ditronics, LLC email disclaimer: > >> > >> This communication, including attachments, is intended only for the > > exclusive use of addressee and may contain proprietary, confidential, or > > privileged information. Any use, review, duplication, disclosure, > > dissemination, or distribution is strictly prohibited. If you were not > > the intended recipient, you have received this communication in error. > > Please notify sender immediately by return e-mail, delete this > > communication, and destroy any copies. > >> > >> > > > >

