Re: The use of dst_conn vs. connslots

From: Jeffrey 'jf' Lim <jfs.world#gmail.com>
Date: Fri, 24 Apr 2009 11:02:24 +0800


On Fri, Apr 24, 2009 at 6:09 AM, Ninad Raje <ninadvr#yahoo.com> wrote:
> Hi,
>
> I recently upgraded haproxy to 1.3.17.
>
> I use dst_conn to divert the excess server load to an alternate backend. I'm
> exploring the possibility of using connslots instead of dst_conn. But to me
> both look the same.
>

they dont. Read the documentation again. It specifically points out the difference between 'dst_conn', and 'connslots'. Although admittedly, the addition of one statement could help to clarify things a lot in this case :) (I should probably add that in - together with a little bit of revision to the code) - "'dst_conn' is for frontends, whereas 'connslots' is for backends."

> My main backend has a pool of 5 servers. Each server handles 100 requests.
> The number 100 includes 20 concurrent, in-process requests + 80 in-queue
> requests. I've following configuration:
> acl use_main dst_conn lt 500
> use_backend main if use_main
> default_backend alternate
>
> Using connslots the configuration looks like,
> acl nearly_full connslots(main) lt 500
> use_backend alternate if nearly_full

you mean 'use_backend main'

> default_backend alternate
>

> I'm not too clear about the value of connslots. The documentation says that
> connslots is defined per backend. My each server handles 100 requests
> (maxconn = 20 + maxqueue = 80, Total = 100). There are 5 servers in main
> backend. What if I add a server or remove a server from the backend? Do I
> have to set the value of connslots again? manually?
>

yes. But then again, you would have to edit the config as well in order to add or remove a server from the backend.

> With reference to my configuration, I was expecting the value of connslots
> to be 100 and not 500. So that I don't have to update this value whenever I
> add/delete servers from my backend.
>

This would only work (wanting to specify 100 in your case - instead of 500) if all the servers in your backend were the same.

> Please share your experiences and help me calrify connslots value.
>
> Also I'm not too sure about the syntax of using connslots. The documentation
> says,
>
> connslots(backend) <integer>
>
> But haproxy 1.3.17 complains with that syntax. I changed the syntax to,
>
> connslots(backend) lt <integer>
>
> The haproxy 1.3.17 does not complain.
>

try that with 'nbsrv'. You get the same thing as well. I believe if you do not specifiy an operator with integer matching that it is assumed to be 'eq'. (But i havent taken too much of a look at the code for this - maybe Willy can clarify here).

-jf

--
In the meantime, here is your PSA:
"It's so hard to write a graphics driver that open-sourcing it would not help."
    -- Andrew Fear, Software Product Manager, NVIDIA Corporation
http://kerneltrap.org/node/7228
Received on 2009/04/24 05:02

This archive was generated by hypermail 2.2.0 : 2009/04/24 05:15 CEST