Thursday, 15 September 2011

asp.net - Best way to keep track of current online users -


I have a requirement that my site always displays the number of online users currently, for example, "35741 users currently Online "This is not based on login, just how many users are currently on my site I have tried to end the session / session for this, although the end of the session is not reliable so I get the bloated numbers Because my session adds a number, but the session does not end them as it is not a fire.

There is no additional information to collect from this (reporting, etc.), it is only requested that the number shows is a very simple request that is changing in a huge deal. Any help is appreciated

Edit:

I should also specify that I have also tried to use a database for it. A simple table containing session ID and The last activity column is included. With each page hit, I check to see if the session is in my database or not. If not, then insert, if so, update with the time of activity, then I run a process that opens the database in search of a session without any activity in the last 20 minutes. This approach seemed to kill my SQL server and / or IIS. The site had to restart

The best way is to do as you do, but it takes time through activity. If a given session does not reach any page within 5 minutes or more, then you can no longer consider them active.


No comments:

Post a Comment