Posted by Neil Wyatt on 10/02/2017 11:41:17:
There are an awful lot of things that can log you out:
…
Neil
At last we've touched on a problem where a superannuated Software Engineer might be able to offer something!
Just as a boiler can only take so much pressure, there is a limit to the number of logged in users that a website can manage. It might be a very large number, or it might be a low one. The existence of a limit could explain some of the symptoms reported.
When people 'log in' to a website, the software adds them to a list held in computer memory. The list contains much more than usernames; for each logged on user there will be a record containing timestamps, cookies, IP addresses, browser type, permissions, and whatever else is needed to provide the user with a 'login necessary' service. All this takes space and there will be a limit somewhere.
What happens when you try to login when a web server doesn't have the capacity to take you on? I've seen all these reactions in the real world, and there are probably more:
- web server falls over in a mumbling heap and has to be restarted to empty the login list. (Such installations usually go down for regular maintenance.)
- web server sends a series of alerts to the system administrator as the login list approaches maximum, but still crashes if nothing is done.
- web server declines new logins until someone logs out.
- web server operates a ring list, where new users overwrite old ones on a first in first out basis. People who've been logged in for a while suddenly get knocked on the head and don't know why.
- web server scans the list trying to find a login to delete to create space. Some software does this one at a time, but more usually a 'garbage collector' scans the whole list and prunes people out wholesale according to some design criteria. Whether or not you are considered 'garbage' is implementation specific, for example, ordinary users are much more likely to be dumped than moderators. Garbage collection is often so intensive that the entire site slows to a crawl whilst it's in progress.
Those of you with criminal minds will have realised that flooding a website with fake login requests might be a good way of hurting it. These types of attack are rather common, and most web servers have some means of recognising and containing assaults without shutting down completely. Self protection may be the reason that a website suddenly becomes slow and inaccessable; it may be fending off an intruder.
Web services are exceptionally efficient if you don't log in. Maintaining lists of users and their privileges adds a heavy overhead compared with servicing anonymous page requests. For that reason, I don't login to the forum unless I intend to post, and I try to log out when I've finished. Back in the day, this was encouraged as 'good neighbour' policy. Nowadays, me worrying about overloading the internet probably means I'm old fashioned! Even so, the forum might have more zip if large numbers of members didn't stay logged in for long periods.
Or there might be a fault…
Dave