Hi All,

I am doing some research and have not really found a great way to configure
HAProxy to get the desired results. The problem I face is that I a service
backed by two separate collections of servers. I would like to split
traffic between these two clusters (either using percentages or weights).
Normally, I would configure a single backend and calculate my weights to
get the desired effect. However, for my use case, the list of servers can
be update dynamically through the API. To maintain correct weighting, I
would then have to re-calculate the weights of every entry to maintain a
correct balance.
An alternative I found was to do the following in my configuration file:
backend haproxy-test
balance roundrobin
server cluster1 u...@cluster1.sock weight 90
server cluster2 u...@cluster2.sock weight 10

listen cluster1
    bind u...@cluster1.sock
    balance roundrobin
    server s1 127.0.0.1:8081

listen cluster2
    bind u...@cluster2.sock
    balance roundrobin
    server s1 127.0.0.1:8082
    server s2 127.0.0.1:8083

This works, but is a bit nasty because it has to take another round trip
through the kernel. Ideally, there would be a way to accomplish this
without having to open unix sockets, but I couldn't find any examples or
any leads in the haproxy docs.

I was wondering if anyone on this list had any ideas to accomplish this
without using extra unix sockets? Or an entirely different way to get the
same effect?

Thanks,
James Root

Reply via email to