Hi Lukas,

Thanks very much for your confirmations and the Stackoverflow post. I just
want to expand a little on the last question relating to websockets
connections.

Let's say I have a backend which exclusively deal with long-lived
connections: websockets and xdr-streaming. These connections tend to stay
open for 30-60 mins, during which both the server and clients send multiple
JSON msgs. The server processing/response time stays on average <10ms per
msg. In a way, you can think of this backend as a game server which reacts
upon receiving a msg from a client.

Currently, I have only one process of this backend running with HAProxy on
the same machine (actually VPS). The machine has 8-core cpu and 1g memory.
I don't expect huge amount of traffic for now. Given this setup, what would
be a sensible 'maxconn' number I should set for the server option of this
backend? Of course, I can estimate roughly the number of concurrent
websockets/streaming connections to my website at any point of time, and
use that number for 'maxconn' on the server. But I feel there must be a
better way to figure out this number optimally.

Some pointers will be much appreciated. Thanks!

Best,

Merton


On Tue, Apr 16, 2013 at 3:52 PM, Lukas Tribus <[email protected]> wrote:

> Hi Merton,
>
> > Please let me know if the above understanding is correct.
>
> Yes, thats the concept.
>
>
>
> > if I have multiple backends (multiple server options), does the
> > sum of 'maxconn' of their server options have to be no more than
> > the 'maxconn' of their corresponding frontend?
>
> Yes that does make sense, although you are probably able to do a
> little oversubscription.
>
>
> > does specify a low 'maxconn' for a server option help improve the
> > performance of that particular server in any way?
>
> Yes it does, because it makes sure your backend servers is never
> overloaded (by dispatching requests to backends with lower load or
> queueing them). In fact iirc some of the ruby folk runs their backends
> with maxconn 1, so a server always handles just one request at the
> time.
>
>
> > if the connections to a particular backend are long-lived, e.g.
> > websocket connections, does it imply that I should set a relatively
> > large 'maxconn' for the server?
>
> Probably yes. The question is, how many of those long-lived sessions
> are concurrently active on how many of them can your backend serve?
>
>
> Here are a few thoughts from another user and a response from Willy about
> queueing:
>
> http://stackoverflow.com/questions/8750518/difference-between-global-maxconn-and-server-maxconn-haproxy
>
>
>
> Regards,
> Lukas

Reply via email to