ls it normal, that crossbar reconnects periodically

#1

I created a crossbar instance behind my nginx server.

The main reason is NOT any performance considaretion, but mainly the fact, that
my nginx server uses port 443 and that I’d like crossbar also to run on port 443.

The setup seems working:

My web application works as well. However:

In my web application’s debug console while idling around
I observe many close and open events.

this discconnect / reconnect seems to happen every few minutes.

Is this normal, to be expected
Is there any way to configure / tune / optimize the number of disconnects / reconnects?

Thanks in advance for some enlightment.

Please look also at my next question (python crossbar client)

0 Likes

#2

Additional info:

If I use the crossbar.py on the same server, but without https and not behind nginx, then don’t have this high frequency of disconnects.

···

On Thursday, June 25, 2015 at 8:09:33 PM UTC+2, Gelonida Gel wrote:

I created a crossbar instance behind my nginx server.

The main reason is NOT any performance considaretion, but mainly the fact, that
my nginx server uses port 443 and that I’d like crossbar also to run on port 443.

The setup seems working:

My web application works as well. However:

In my web application’s debug console while idling around
I observe many close and open events.

this discconnect / reconnect seems to happen every few minutes.

Is this normal, to be expected
Is there any way to configure / tune / optimize the number of disconnects / reconnects?

Thanks in advance for some enlightment.

Please look also at my next question (python crossbar client)

0 Likes

#3

My best guess would be, that Nginx has some default timeouts on inactive, reverse-proxied WebSocket connections.

Either you can make Crossbar.io issue WebSocket auto ping/pongs (http://crossbar.io/docs/WebSocket-Options/#available-options), or you could tune Nginx settings.

Note that for production, you might want to timeout inactive connections to save resources, as many users will open dozens of browser tabs, leave their computer on and then walk away for a longer time. Depends on situation.

Cheers,
/Tobias

···

Am Donnerstag, 25. Juni 2015 20:09:33 UTC+2 schrieb Gelonida Gel:

I created a crossbar instance behind my nginx server.

The main reason is NOT any performance considaretion, but mainly the fact, that
my nginx server uses port 443 and that I’d like crossbar also to run on port 443.

The setup seems working:

My web application works as well. However:

In my web application’s debug console while idling around
I observe many close and open events.

this discconnect / reconnect seems to happen every few minutes.

Is this normal, to be expected
Is there any way to configure / tune / optimize the number of disconnects / reconnects?

Thanks in advance for some enlightment.

Please look also at my next question (python crossbar client)

0 Likes

#4

Hi Tobias,

Thanks for your answer.

My best guess would be, that Nginx has some default timeouts on inactive, reverse-proxied WebSocket connections.

Either you can make Crossbar.io issue WebSocket auto ping/pongs (http://crossbar.io/docs/WebSocket-Options/#available-options), or you could tune Nginx settings.

Note that for production, you might want to timeout inactive connections to save resources, as many users will open dozens of browser tabs, leave their computer on and then walk away for a longer time. Depends on situation.

I created a crossbar instance behind my nginx server.

The main reason is NOT any performance considaretion, but mainly the fact, that
my nginx server uses port 443 and that I’d like crossbar also to run on port 443.

The setup seems working:

My web application works as well. However:

In my web application’s debug console while idling around
I observe many close and open events.

this discconnect / reconnect seems to happen every few minutes.

Is this normal, to be expected
Is there any way to configure / tune / optimize the number of disconnects / reconnects?

Thanks in advance for some enlightment.

Please look also at my next question (python crossbar client)

There seem to be two nginx parameters, which might have an impact.
one is keepalive_timeout
and the other is ssl_session_timeout
not sure which one applies.
will play with these params.
OK: I’ll add auto_ping_interval and see whether it changes anything.
What I am confused about is the documentation of auto_ping_size: (Payload size for pings sent, must be between 4 and 125 (default: null))
Do I have to set it to set its value? Reading the spec it seems, that the default value is invalid.

···

On Monday, June 29, 2015 at 11:49:07 PM UTC+2, Tobias Oberstein wrote:

Am Donnerstag, 25. Juni 2015 20:09:33 UTC+2 schrieb Gelonida Gel:

0 Likes

#5

Hi Gelonida,

> OK: I'll add auto_ping_interval and see whether it changes anything.

What I am confused about is the documentation of |auto_ping_size|:
(Payload size for pings sent, must be between *4* and *125* (default:
*null*))
Do I have to set it to set its value? Reading the spec it seems, that
the default value is invalid.

You are right, the docs are misleading (and in fact wrong rgd. the defaults).

I have corrected this: http://crossbar.io/docs/WebSocket-Options/#available-options

You only need to set auto_ping_interval > 0 to enable sending auto-pings (of default size 4 bytes).

The recommended settings for production are:

http://crossbar.io/docs/WebSocket-Options/#production-settings

Ah, btw: there is a page for Nginx http://crossbar.io/docs/Reverse-Proxies/

Empty though;) I guess your Nginx configuration and findings would be very interesting to others as well. If you like, you could do a pull-request against the Crossbar.io docs:

E.g. above doc page is generated from a Markdown source file here

https://github.com/crossbario/crossbarwww/blob/master/website/crossbario/docs/Reverse-Proxies.md

Cheers,
/Tobias

···

--
You received this message because you are subscribed to the Google
Groups "Crossbar" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to crossbario+...@googlegroups.com
<mailto:crossbario+...@googlegroups.com>.
To post to this group, send email to cross...@googlegroups.com
<mailto:cross...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/crossbario/6392d59c-78c8-4ca3-82c2-fe1b9bfc57dd%40googlegroups.com
<https://groups.google.com/d/msgid/crossbario/6392d59c-78c8-4ca3-82c2-fe1b9bfc57dd%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes