微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用ASP.NET会话状态服务器(而不是InProc)的优点和缺点?

在开始使用会话状态服务器之前,为了使我的应用程序中的会话状态与InProc状态相比更为强大,我想要找到一些优点和缺点来进行评估。

更新1:还有关于幸存应用程序池的回收?

更新2:会话的长寿及其结局如何?

解决方法

这是对您的三个选项的优缺点的规范分析,来自Rob Howard的 ASP.NET Session State文章
  • In process. In process will perform best because the session state memory is kept within the ASP.NET process. For Web applications hosted on a single server,applications in which the user is guaranteed to be re-directed to the correct server,or when session state data is not critical (in the sense that it can be re-constructed or re-populated),this is the mode to choose.

  • Out of process. This mode is best used when performance is important but you can’t guarantee which server a user will request an application from. With out-of-process mode,you get the performance of reading from memory and the reliability of a separate process that manages the state for all servers.

  • sql Server. This mode is best used when the reliability of the data is fundamental to the stability of the application,as the database can be clustered for failure scenarios. The performance isn’t as fast as out of process,but the tradeoff is the higher level of reliability.

进程外(也称为“状态服务器”)和sql Server服务器选项都可以在Web应用程序重新启动(包括应用程序池循环)中运行,并且都可以将会话数据提供给群集/服务器场中的多个服务器。

最后,它可能不用说,但基本的进程内设置是最简单的配置,这在许多环境中是一个有意义的“亲”。

Tim Sneath的ASP.NET Session State: Architectural and Performance Considerations增加了一些额外的信息,MSDN topic on Session State Modes一个可靠的最新来源。

原文地址:https://www.jb51.cc/aspnet/252101.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐