Mikhail Glukhov
Mikhail Glukhov

Reputation: 1809

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.

Upvotes: 0

Views: 4098

Answers (4)

Dmytrii Nagirniak
Dmytrii Nagirniak

Reputation: 24088

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.

Upvotes: 1

spender
spender

Reputation: 120450

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

Upvotes: 0

duffymo
duffymo

Reputation: 308763

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

Upvotes: 0

baldy
baldy

Reputation: 5541

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.

Upvotes: 0

Related Questions