English 中文(简体)
Network Load Balancing (NLB): is it suitable for "stateful" ASP.NET applications?
原标题:

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.

问题回答

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.

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.

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

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





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签