Sql SessionState Server and Timeout
Hi is there a downside to using Sql Server as a SessionState server and increasing the timeout to 开发者_如何学Python2 weeks? My goal is to keep people logged in as long as possible while keeping webserver memory at a minimum.
I think you might have a few concepts confused here a bit.
SessionState and "Logged In" can mean two different things.
SessionState represents objects/data stored in the "Session" object within the environment. The users login is typically controlled using the ASP.NET Membership system. You can have a user that has a persistent login (Remember Me) but the session will time out after 20 minutes. The system will still remember them, but data that was "cached" for the user in session might be gone.
More directly to your question, yes, there are NUMEROUS issues with this type of approach for SQL Session State, and depending on the size of the values put to session and the traffic it could be more or less extreme.
This information is still going to take memory, just hard-disk memory on the DB side, but as it grows you can see performance reductions. Session abandonment alone could cause massive amounts of data cached.
As the number of session items grows, the performance of session will degrade, and the load on the SQL Server system will be more.
Depending on the size of the server, and the SQL Server license, and the traffic you could have issues with DB or hardware limitations storing session for that long.
What are the information you store in the session? They consume server resource and its not a general practice to keep them alive for 2 weeks.
You can store a cookie to mark the user as logged in and load the session data when he comes back again.
精彩评论