优点和缺点使用ASP.NET会话状态服务器(而不是是InProc)的? [英] Pros and Cons of using ASP.NET Session State Server (instead of InProc)?

查看:172
本文介绍了优点和缺点使用ASP.NET会话状态服务器(而不是是InProc)的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用会话状态服务器制造会话状态在我的应用程序更稳健相比是InProc国家的利益之前,我想找到评估利弊清单。

Before I start using Session State server for the benefit of making session state more robust in my apps compared to InProc state, I'd like to find a list of Pros and Cons for evaluation.

更新1 :兼论尚存的应用程序池回收

Update 1: Also about surviving application pool recycles?

更新2 :?什么会长寿和他们的结局

Update 2: What about longevity of sessions and their endings?

推荐答案

下面是你的三个选项的利弊的规范分析,从罗布霍华德的 ASP.NET会话状态文章:

Here's the canonical analysis of the pros and cons of your three options, from Rob Howard's ASP.NET Session State article:


      
  • 在过程。在过程中会表现最佳,因为会话状态的内存保持在ASP.NET进程中。托管在单个服务器上的Web应用程序,其中用户是有保证的应用程序被重新定向到正确的服务器时,或者当会话状态数据不是关键的(在这个意义上,它可以被重新构造或重新填充) ,这是选择的模式。

  • 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服务器即可。该模式最好一起使用时的数据的可靠性是应用程序的稳定性根本,作为数据库可以群集为故障情形。性能是不一样快出的过程,但代价是可靠性更高的水平。

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服务器的选项都存活的Web应用程序重新启动(包括应用程序池循环)无一不使会话数据提供给多台服务器组成的集群/农场。

The out-of-process (aka "StateServer") and SQL-Server options both survive web application restarts (including application pool cycling) and both make session data available to multiple servers in a cluster / farm.

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

Finally, it may go without saying, but the basic in-process setup is the easiest to configure, which is a meaningful "pro" in many environments.

添斯尼斯的 ASP.NET会话状态:建筑和性能考虑增加一些额外的信息,并在会话状态模式的 MSDN主题是一个可靠的,最新的于─日期来源。

Tim Sneath's ASP.NET Session State: Architectural and Performance Considerations adds some additional information, and the MSDN topic on Session State Modes is a reliable, up-to-date source.

这篇关于优点和缺点使用ASP.NET会话状态服务器(而不是是InProc)的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆