Hi,

> In the latest HAProxy 1.5 release (dev22), it is indicated that
> keep-alive is now enabled by default for both client and server sides.
> I have some questions regarding its use in the following scenario.
>
> I use HAProxy in front of an array of servers: one nginx for
> delivering static files, and the others being application servers. One
> of the application servers exclusively deals with websocket (or in the
> event of ws failure, switching to streaming) connections. Currently, I
> am using 'http-server-close' by default for all servers, but I think
> it'd be better to switch to 'http-keep-alive' for the nginx and keep
> 'http-server-close' for the websockets server.

You can just default to http-keep-alive everywhere.

HAProxy recognizes the upgrade headers and switches to TCP mode
automatically [1].

Recognizing the upgrade in a HTTP transaction is possible with all modes
expect tcp mode (of course) and (the pre-dev22 default) http tunnel mode [2].



> Is this a correct setup? Thanks.

It is, but you may as well simplify it with http-keep-alive on all sections.

I don't see any advantage by configuring http-server-close on the websocket
backend.

Of course you should test this, before putting it in production.



Regards,

Lukas



[1] http://blog.exceliance.fr/2012/11/07/websockets-load-balancing-with-haproxy/
[2] http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4              
                          

Reply via email to