SQLServer 与 StateServer 的 ASP.NET 会话状态性能 [英] SQLServer vs StateServer for ASP.NET Session State Performance

查看:27
本文介绍了SQLServer 与 StateServer 的 ASP.NET 会话状态性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在攻读 MS 认证,我正在做的一项练习测试有一个问题,其中争论的焦点是在 SQL Server 中存储会话与在 StateServer 中存储会话之间的性能.

I'm studying for a MS certification and one of the practice tests I'm doing has a question where the point of contention is the performance between storing the session in SQL Server as opposed to StateServer.

鉴于应用在网络场中运行,哪种会话状态解决方案可提供最佳性能(SQL Server 或 StateServer),最重要的是,为什么?

Given the app is running in a web farm, which solution for session state gives the best performance (SQL Server or StateServer) and most importantly, why?

推荐答案

State Server 速度更快,因为它将会话数据存储在内存字典中.SQL Server 速度较慢,因为它存储在将数据持久化到磁盘的数据库中.

State Server is faster because it stores session data in an in-memory dictionary. SQL Server is slower because it's stored in a database which persists data to disk.

SQL Server 也较慢,因为所有内容都存储在一个表中,随着越来越多的客户端访问/更新会话数据,这会导致争用.

SQL server is also slower because everything is stored in one table which leads to contention as more and more clients access/update the session data.

SQL 服务器更可靠,因为它被持久化到磁盘,并且可以设置为具有故障转移功能的集群.

SQL server is more reliable because it is persisted to disk and can be set up as a cluster with failover capability.

请参阅这篇文章中的序言以获取深入的解释.

See the preamble in this article for an indepth explanation.

这篇关于SQLServer 与 StateServer 的 ASP.NET 会话状态性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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