加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 00:22:13 所属栏目:asp.Net 来源:网络整理
导读:在开始使用会话状态服务器之前,为了使我的应用程序中的会话状态与InProc状态相比更为强大,我想要找到一些优点和缺点来进行评估。 更新1:还有关于幸存应用程序池的回收? 更新2:会话的长寿及其结局如何? 解决方法 这是对您的三个选项的优缺点的规范分析
在开始使用会话状态服务器之前,为了使我的应用程序中的会话状态与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是一个可靠的最新来源。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读