On Thu, Sep 4, 2014 at 2:25 AM, Steven Le Roux <[email protected]> wrote: > Hi, > > You can either play with : > > - balance url_param ld > > - sticky table, and then set the param you want to stick on : > stick on urlp(ld) table ... > > - appsession ld len 3 timeout <holdtime> request-learn mode query-string > > w/ something like : > > server server_A ... cookie lb=100 weight 10 > server server_A ... weight 10 > > > But I think the most simple configuration for you here is to use > multiple backend if you can : > > frontend App > ... > acl url_ld100 url_sub ld=100 > use_backend bk_ld100 if url_ld100 > default_backend default > > backend bk_ld100 > ... > balance roundrobin > server server_A <ip:port> check > server server_B <ip:port> check backup > > > backend default > ... > balance roundrobin > server server_A <ip:port> check > server server_B <ip:port> check > > > It means that, when your front parse ld=100 in the url query string, > it matches the acl url_ld100, then use a dedicated backend : bk_ld100. > In this backend only server A server request since server B is defined > as a backup server. If A goes down, B will answer request. So you need > "check" on your servers. > > If ld=100 is not matched, your request will end to the default server, > which will roundrobin btw A and B. > > > Regards, > > On Wed, Sep 3, 2014 at 11:47 PM, S. Zhou <[email protected]> wrote: >> We are thinking of the following LB algorithm but we are not sure if current >> HAProxy supports it: >> given a http request, LB should always forward it to a certain backend >> server (say Server A) based on its http parameter (e.g. request with >> parameter "Id=100" always go to server A). The only exception is: when the >> designated server (e.g. Server A) is down, then the request should be >> forwarded to another (fixed) server (e.g. Server B). >> >> Thanks >> > > > > -- > Steven Le Roux > Jabber-ID : [email protected] > 0x39494CCB <[email protected]> > 2FF7 226B 552E 4709 03F0 6281 72D7 A010 3949 4CCB >
Hi Guys, You can do this directly in your backend using the use-server directive and some acl like urlp and srv_is_up. Baptiste

