开发者

session variables for out of proc cause memory problems?

开发者 https://www.devze.com 2023-04-11 01:58 出处:网络
In my current asp.net application, i\'m storing the session variables in the SQL server. If you specify InProc, then the session is kept in the server memory, but for out of proc (in my case), the ses

In my current asp.net application, i'm storing the session variables in the SQL server. If you specify InProc, then the session is kept in the server memory, but for out of proc (in my case), the session is kept in SQL server.

Is this really true? From what I read, with every request that needs session access (basically every page request) will deserialize the session from db and save it back 开发者_StackOverflowonce the request completes. This means that the values will be kept on the web server once it is retreived. How is this different from the InProc then?

For Out of Proc, does it only retreive the one session variable when that is requested for? Otherwise, it sounds to me like it is the same as InProc. What am I missing.


Is this really true?

Yes, it's true.

From what I read, with every request that needs session access (basically every page request) will deserialize the session from db and save it back once the request completes. This means that the values will be kept on the web server once it is retreived. How is this different from the InProc then?

Values are stored in memory only for the duration of the HTTP request. In the beginning of the request they are loaded from SQL Server and at the end of the request they are saved into SQL Server. This is different than InProc where values are kept into memory between requests. And because different requests (from the same user) could be served by different nodes in your server farm, using SQL Server guarantees that all nodes of the farm will share the same session values.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号