Haproxy balance roundrobin


#1

Dear Friends,

I have a doubt

My backend has only 2 servers (vmp103 and vmp104)

You can perform the balancing as follows:

2 requests for vmp103 and 2 requests for VMP104

By the settings the balancemaneto is being done as follows:

1 request for vmp103 and 1 request for vmp104

Is it possible to balance 2 to 2 instead of 1 to 1?

Follows my settings

global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user root
group root
daemon

defaults
log global
option dontlognull
mode http
option httplog
stats uri /stats
timeout connect 5000
timeout client 50000
timeout server 50000

frontend http_front
bind *:8089
default_backend http_back

backend http_back
balance roundrobin
option httpchk GET /intacesso/intstatus.do?perfil=HTTP_APROVREQ
server vmp103 10.50.50.103:8080 check
server vmp104 10.50.50.104:8080 check

Best Regards


#2

with stickness you may perform this behavior.
for so:
option httpchk GET /intacesso/intstatus.do?perfil=HTTP_APROVREQ
cookie WEBSRV insert
server vmp103 10.50.50.103:8080 cookie srv1 check
server vmp104 10.50.50.104:8080 cookie srv2 check

And with curl you should use like: curl <IP_HAPROXY_SERVER> --cookie “WEBSRV=srv1” ### if you want stickness on vmp103, else use srv2 instead of srv1 in curl command above.