Re: Timeout tuning for websocket proxy

2018-02-23 Thread Artur

  
  
Hello,

Le 16/02/2018 à 22:47, Aleksandar Lazic
  a écrit :


  The timeout for Websockets is this

https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4-timeout%20tunnel

What's the setting for this timeout in your config?

Please share also which version you use maybe the doclink is wrong for
the version you use.



Le 16/02/2018 à 21:42, Baptiste a
  écrit :


  

  This blog article should answer your
questions:
https://www.haproxy.com/fr/blog/websockets-load-balancing-with-haproxy/


That said, since the time of this article, we release
  the "tcp-ut" that you may want to set as well to detect
  faster when a client has disconnected.


Note that a best practice is to implement an
  application layer "ping" every 1 minute and set the
  timeout tunnel to 61s.
  

  


Thank you all for the links and sorry for a late feedback.
Haproxy is the current stable version 1.8.4.
My current 'timeout tunnel' is 1h.
However in node.js websocket engine the ping is currently set at 15
seconds and the ping timeout is at 30 seconds.
So it seems that 1h tunnel timeout  is quite too long. Something
like suggested 61 seconds may be much more appropriate (or even less
than that?).
I'm trying to be cautious about setting this timeout too low because
there are mobile clients and mobile networks may experience some
important lags sometimes.

I am not sure tcp-ut may help here as there is an internal websocket
keepalive feature enabled, so there is always some traffic passing
through the TCP connection.
-- 
Best regards,
Artur
  




Re: Timeout tuning for websocket proxy

2018-02-16 Thread Aleksandar Lazic
Hi.

Am 16.02.2018 um 16:36 schrieb Artur:
> Hello,
> 
> I have a haproxy setup with node.js application in backend.
> Clients connect websockets to node.js application through haproxy and
> these connections are usually established for a long time, one or more
> hours.
> 
> I wondered if there is any need to adjust default haproxy.cfg timeouts
> at different levels?
> As I'm here, maybe you have some other suggestions on websocket specific
> setup/options tuning?

The timeout for Websockets is this

https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4-timeout%20tunnel

What's the setting for this timeout in your config?

Please share also which version you use maybe the doclink is wrong for
the version you use.

Best regards
aleks



Re: Timeout tuning for websocket proxy

2018-02-16 Thread Baptiste
On Fri, Feb 16, 2018 at 4:36 PM, Artur  wrote:

> Hello,
>
> I have a haproxy setup with node.js application in backend.
> Clients connect websockets to node.js application through haproxy and
> these connections are usually established for a long time, one or more
> hours.
>
> I wondered if there is any need to adjust default haproxy.cfg timeouts
> at different levels?
> As I'm here, maybe you have some other suggestions on websocket specific
> setup/options tuning?
>
> --
> Best regards,
> Artur
>
>
>
Hi,

This blog article should answer your questions:
https://www.haproxy.com/fr/blog/websockets-load-balancing-with-haproxy/

That said, since the time of this article, we release the "tcp-ut" that you
may want to set as well to detect faster when a client has disconnected.

Note that a best practice is to implement an application layer "ping" every
1 minute and set the timeout tunnel to 61s.

Baptiste