Just wondering what the community uses for the disconnectTimeSec value for the mixmax:smart-disconnect package ?
I understand the default is 60s.
What are your values and why did you make that decision pertaining to how your apps are used?
Have you noticed it’s led to positive performance impact for your users?
Think of situations where a user switches to another tab in the browser or brings something else in foreground.
Could be:
a user has opened a new link (in a new tab) from inside your app, is going “away” to that tab to read the content. The user will take some time to read or just close the new tab and come back quickly to your app. 60 sec. seems a good time to wait for the user to decide.
a user moves to a new tab for a while. In FB or Whatsapp on web, or in other networks, if you get an update inside your app, the browser tab shows the number of new notifications. If your app is disconnected you will not see that.
a user has left your app opened in a tab and forgot about it entirely. You would probably want to disconnect that.
others…
On reconnect, your client resubscribes to the previously active subscriptions and gets the updates.
I think 60 sec is the right time to wait for a user to come back. If you expect few concurrent users, 5-10 minutes is also fine.
#1, for browsers, it does not make sense to set this to longer than 5 minutes as browsers like chrome will automatically kill background tabs after such duration anyway
No, the client will be disconnected. But the main problem is with the reconnection as Meteor will not always automatically reconnect when the tab becomes active unless the user refreshes the browser tab which is a big usability issue e.g. some clicks requiring connection will stop working. It does not always reconnect using this package because of the unsupported page visibility state as I have posted above
We’ve been leaving connections active and noticed some get orphaned. On the server, I can see the number inch up over a few days. Bouncing the server will often clear many of them.
@rjdavid – you think the page being disconnected, with the tab or browser later closed, is causing this?
As well, my understanding is HCP relies on having an open connection. Any disconnect – I was thinking of disconnecting on idle login pages – will need to confirm HCP is complete first, yes?
@gdc3 I am not aware of how or where to track orphaned connections. Is this available in the APM?
Regarding HCP, I believe that Meteor handles this during disconnection and reconnection although admittedly, it has been a year since I have created a Cordova app
@rjdavid – Our users subscribe to a hairy query that then cascades to grab additional data. Despite a bunch of dramatic performance tuning, this makes things still pretty server intensive.
I suspected a leak upon seeing our server consistently falling over with the same kind of weird error after 7-10 days of up time. I added to the Meteor.onConnection and connection.onClose callbacks to count sessions and track type (actively logged in or just passively open on login page).
We rarely see many of the latter but I do see the number of active sessions grow. It doesn’t only go up, but the number trends up over time. A server bounce resets the count to something much lower – hence me thinking orphaned sessions.
You’d think the sockets heartbeat would terminate a frozen client, but that doesn’t seem to be happening in all cases.