高可用性 ASP.NET MVC

发布于 2024-09-04 19:25:22 字数 81 浏览 2 评论 0原文

当构建具有高可用性目标的 ASP.NET MVC 应用程序时,如果没有可用的状态服务器,将会话状态保留在 SQL Server 上是否是一个好习惯?

When building an ASP.NET MVC application with a goal of high availability, is it a good practice to keep the session state on the SQL Server, if there is no state server available?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

纸短情长 2024-09-11 19:25:22

这里的要点实际上是,您有 2-3 个网络服务器,就像您在对 Craigs 答案的评论中提到的那样。

一种方法是使用 SQL-server sessionstate,它有自己的问题 http://idunno.org/articles/ 277.aspx

如果你有这个 SQL-Server,我会小心的,因为会话状态数据库会给它带来沉重的负载。每个请求都会写入数据库。

我们使用 2 个网络服务器和一个具有粘性会话的负载均衡器。如果您的第一个请求最终出现在服务器 1 中,那么您的所有请求都由服务器 1 处理。(这有点复杂,但您明白了。)

这可能并不总是最好的解决方案,但至少在我们的网站上(它是用户通常会停留 20-30 分钟的商店)效果很好。我们只使用很少的 SessionState,并且大部分用户特定的内容都由 ProfileSystem 存储。但我想如果请求发送到不同的服务器,ProfileSystem 也会失败。

The point here realy is that you have 2-3 webservers like you mentioned in the comment to Craigs answer.

One way is to use SQL-server sessionstate which has its own problems http://idunno.org/articles/277.aspx.

If you have this one SQL-Server I would be carefull, because the DB for sessionstate will put heavy load on it. Each request will write to the db.

We use 2 webservers and a Loadbalancer that has sticky sessions. If your first request ends up in server 1 then all your requests are handled by server 1. (Its a bit more sophisticated but you get the idea.)

This might not allways be the best solution, but at least on our site (its a shop where user typically stay 20-30minutes) it works well. We use only little SessionState and have most of the userspecific stuff stored by the ProfileSystem. But I guess the ProfileSystem will also fail if requests go to different servers.

挽清梦 2024-09-11 19:25:22

我建议改为 AppFabric 缓存(fka Velocity)。

I'd suggest AppFabric Caching (f.k.a. Velocity) instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文