You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently sessions are never removed from memory, and we prevent the server from running out of memory by externally restarting it every Sunday morning.
Instead of this, we can automatically remove sessions from the ShareDB some time after the last user disconnects.
Implementation:
Track the number of users connected to each session by binding to the WebSocket connect/disconnect events. Also track the last disconnect time.
Every hour or so, remove sessions that have no users and whose last disconnection time is more than an hour old.
The text was updated successfully, but these errors were encountered:
Not sure if this is better than what we have. There might be the following case: students accidentally lose track of the browser tab that they are using. If they realize this before Sunday morning, they can retrieve the content with the session key, which they probably have in some telegram message.
Another issue is security: This is publicly available, and people could abuse the system as a chat service. If they do that, the weekly reboot means that we are not accumulating any storage.
That's fair I guess. We can stick with the current setup.
I was worried the server might run out of memory towards the end of the week if all sessions are kept until Sunday—because that means memory usage simply grows as the week progresses until Sunday. Removing old sessions periodically would keep the memory usage to just the most recent one or two hours or so.
As far as I know this problem has not occurred yet; it's just a concern that I had, since I expect this feature will see much greater usage this semester.
Currently sessions are never removed from memory, and we prevent the server from running out of memory by externally restarting it every Sunday morning.
Instead of this, we can automatically remove sessions from the ShareDB some time after the last user disconnects.
Implementation:
The text was updated successfully, but these errors were encountered: