gpt4 book ai didi

asp.net - 使用 ASP.NET session 状态服务器(而不是 InProc)的优缺点?

转载 作者:行者123 更新时间:2023-12-03 11:08:18 25 4
gpt4 key购买 nike

在我开始使用 session 状态服务器以让我的应用程序中的 session 状态比 InProc 状态更健壮之前,我想找到一个优缺点列表进行评估。

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

更新 2 : session 的持续时间及其结局如何?

最佳答案

以下是 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.


进程外(又名“StateServer”)和 SQL-Server 选项都可以在 Web 应用程序重新启动(包括应用程序池循环)后继续存在,并且都使 session 数据可用于集群/场中的多个服务器。
最后,不言而喻,但基本的进程内设置是最容易配置的,这在许多环境中都是有意义的“专业”。
Tim Sneath 的 ASP.NET Session State: Architectural and Performance Considerations添加了一些附加信息,以及 MSDN topic on Session State Modes是一个可靠的、最新的来源。

关于asp.net - 使用 ASP.NET session 状态服务器(而不是 InProc)的优缺点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2714288/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com