sockjs-tornado SockJSRouter settings

68 views
Skip to first unread message

John Goodleaf

unread,
Feb 28, 2014, 4:34:02 PM2/28/14
to soc...@googlegroups.com
Before I engage in a bunch of adventuring does anyone have any tips concerning the practical effects of changing the default settings of the Router object?

I have in mind 
session_check_interval
disconnect_delay
heartbeat_delay

I am running a sockjs server (tornado) in Heroku and I see a lot of disconnections. I'm looking for a way of keeping the connections more stable, even if it costs a little performance. And I don't know how these settings affect the server in practice (though heartbeat_delay has a scary warning attached to it so it MUST do something dangerous, right?)
J

Serge S. Koval

unread,
Feb 28, 2014, 5:59:37 PM2/28/14
to jgoo...@stadi.us, sockjs
Here are some information behind the settings:

1. `session_check_interval` controls how often sessions are checked. If session is expired (there's no connection for more than `disconnect_delay` seconds), it will be removed and `on_close` will be called
2. `disconnect_delay` - for polling transports, how long it should take for session (and SockJS connection as a result) to be closed. Default - 5 seconds
3. `heartbeat_delay` - how often to send heartbeat to the client. SockJS protocol suggests 25 seconds as a default value.

Reason why might see disconnects: if client is on slow connection, is using polling transport and server is trying to push more than client can receive in 5 seconds, session will be closed. For example, Meteor has `disconnect_delay` (or whatever it is called in sockjs-node) set to 60 seconds.

Serge.


--
You received this message because you are subscribed to the Google Groups "sockjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sockjs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages