网络负载平衡(NLB):是否适合“有状态”网络ASP.NET 应用程序?

发布于 2024-08-13 03:34:00 字数 492 浏览 1 评论 0原文

我发布了以下有​​关 ASP.NET Web Farm 的问题。

如何创建 ASP.NET 网络场?

建议使用网络负载平衡 (NLB) 作为创建网络场的主要方式。

然而,Wikipedia 表示“NLBS 旨在用于……无状态应用程序”。然而,我们的网络应用程序绝对是“有状态的”:它是一个封闭的网站,用户可以通过登录名和密码访问,每个用户的信息都不同:人们会看到自己的交易和操作。

在这种情况下,我们是否仍应使用 NLB

谢谢。

I have posted the following question concerning ASP.NET web farms.

How to create an ASP.NET web farm?

Guys recommended using Network Load Balancing (NLB) as a primary way of creating a web farm.

However, Wikipedia says that "NLBS is intended for ... stateless applications". Our web application, however, is absolutely "stateful": it is a closed site to which users will have access by login and password, and information for every user will be different: people will see their own trades and operations.

Should we still use NLB in this scenario?

Thank you.

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

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

发布评论

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

评论(4

四叶草在未来唯美盛开 2024-08-20 03:34:00

在这种情况下我们是否仍然应该使用 NLB?

如果您遵循指南,就没有理由不这样做。

Web 应用程序本质上是无状态的,因此即使您的用户应该登录,它也不会使应用程序成为有状态的。

ASP.NET 中有状态的事物包括:

  • 会话状态
  • 缓存

,可以在 WebFarm 中进行适当配置。

以下是有关如何配置 NLB 的示例

Should we still use NLB in this scenario?

Do not see reasons why not if you follow the guidelines.

The web application is by nature stateless, so even if your users should log-in it does not make the application stateful.

Couple the things which ARE stateful in ASP.NET are:

  • Session State
  • Cache

which can be configured appropriately in a WebFarm.

Here is an example on how to configure the NLB.

云胡 2024-08-20 03:34:00

您仍然可以使用 NLB,但您需要一个支持粘性会话的 NLB,这意味着它始终将流量从某个客户端路由到同一 Web 服务器。就负载平衡而言,这不是最好的解决方案,但至少允许您扩展到多个服务器。

You can still use a NLB, but you need one that supports Sticky Sessions, meaning that it will always route traffic from a certain client to the same web server. Not the best solution in terms of load balancing, but at least allows you to grow to multiple servers.

╄→承喏 2024-08-20 03:34:00

我认为负载均衡还是可取的。您只需对其进行设置,以便会话“粘性”:会话打开后:

http://technet.microsoft.com/en-us/library/bb734910.aspx

I think load balancing is still desirable. You just need to set it up so sessions are "sticky": once a session is open:

http://technet.microsoft.com/en-us/library/bb734910.aspx

∞觅青森が 2024-08-20 03:34:00

绝对是的。您可以采用一些策略来维护场中服务器之间的状态。对于场中的所有 Web 服务器,machineKey 设置应该相同,以便身份验证票证在计算机之间有效。

http://msdn.microsoft.com/en-us/library/ ms998288.aspx#paght000007_webfarmdeploymentconsiderations

有几个选项可用于管理 Web 服务器之间的会话状态:

http://msdn.microsoft.com/en-us/library/z1hkazw7.aspx

http://support.microsoft.com/kb/311209

Absolutely, yes. There are strategies you can employ to maintain state between servers in your farm. The machineKey settings should be the same for all webservers in your farm so that auth tickets are valid between machines.

http://msdn.microsoft.com/en-us/library/ms998288.aspx#paght000007_webfarmdeploymentconsiderations

There are a few options for managing session state between your webservers:

http://msdn.microsoft.com/en-us/library/z1hkazw7.aspx

http://support.microsoft.com/kb/311209

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