ls it normal, that crossbar reconnects periodically

137 views
Skip to first unread message

Gelonida Gel

unread,
Jun 25, 2015, 2:09:33 PM6/25/15
to cross...@googlegroups.com
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)



Gelonida Gel

unread,
Jun 25, 2015, 2:29:40 PM6/25/15
to cross...@googlegroups.com
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.

Tobias Oberstein

unread,
Jun 29, 2015, 5:49:07 PM6/29/15
to cross...@googlegroups.com, gelo...@gmail.com
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

Gelonida Gel

unread,
Jun 30, 2015, 9:02:57 AM6/30/15
to cross...@googlegroups.com, gelo...@gmail.com
Hi Tobias,

Thanks for your answer.



On Monday, June 29, 2015 at 11:49:07 PM UTC+2, Tobias Oberstein wrote:
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.


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)


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.

Tobias Oberstein

unread,
Jun 30, 2015, 9:40:48 AM6/30/15
to cross...@googlegroups.com, gelo...@gmail.com
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.

Reply all
Reply to author
Forward
0 new messages