Hi Vivek,

You can do this I think with the first scheduler so the option "balance
first" :

This is what haproxy doc says:

      first       The first server with available connection slots receives
the
                  connection. The servers are chosen from the lowest numeric
                  identifier to the highest (see server parameter "id"),
which
                  defaults to the server's position in the farm. Once a
server
                  reaches its maxconn value, the next server is used. It
does
                  not make sense to use this algorithm without setting
maxconn.
                  The purpose of this algorithm is to always use the
smallest
                  number of servers so that extra servers can be powered off
                  during non-intensive hours. This algorithm ignores the
server
                  weight, and brings more benefit to long session such as
RDP
                  or IMAP than HTTP, though it can be useful there too. In
                  order to use this algorithm efficiently, it is recommended
                  that a cloud controller regularly checks server usage to
turn
                  them off when unused, and regularly checks backend queue
to
                  turn new servers on when the queue inflates.
Alternatively,
                  using "http-check send-state" may inform servers on the
load.

Otherwise you may be able to do something based on session rate with ACL's,
I used this config once previously :

frontend TestVIP 192.168.0.236:80 <http://192.168.0.236/> transparent
mode http
maxconn 40000
option accept-invalid-http-request
acl max_conn_reached srv_sess_rate(prod/ProdRIP) gt 10
acl prod_dead nbsrv(prod) lt 1
acl whitelist hdr_sub(Cookie) -i SERVERID
default_backend prod
use_backend prod if whitelist
use_backend fallback if max_conn_reached OR prod_dead

backend prod
     mode http
     balance leastconn
option abortonclose
option forwardfor
option accept-invalid-http-response
option http-keep-alive
cookie SERVERID insert nocache indirect
     server ProdRIP 192.168.0.245 weight 100 cookie ProdRIP check port 80
inter 4000 rise 2 fall 2 minconn 0 maxconn 0


backend fallback
mode http
balance leastconn
option abortonclose
option forwardfor
option accept-invalid-http-response
option http-keep-alive
server FallbackRIP 192.168.0.246 weight 100 minconn 0 maxconn 0

Regards

Aaron West

Loadbalancer.org Limited
+44 (0)330 380 1064
www.loadbalancer.org

On 18 August 2015 at 13:06, vivek pal <mr.vivek...@gmail.com> wrote:

>
> Hi,
>
> We have configured haproxy with balance roundrobin, added 2 web server
> web1,web2 and map website.domain.com with haproxy ip when we hit
> website.domain.com into browser it's working, request is transferring
> both server. We want to set first 100 hit sent to web1 and rest web2. is it
> possible?
>
> Regards,
>
> Vivek Pal.
>
>

Reply via email to