Oddur Magnusson

Object reference not set to an instance of a human being

HttpApplicationState and load balanced web servers

Today I've been getting our CMS system to run on a load balanced server setup.

Setting up the Load Balance Cluster is really easy in Windows Server 2003 (I'm using the web edition) once you figure out how it works.

Running a asp.net application on multiple servers requires you to keep the session and application state in sync across servers, so it a client suddenly switches to another server his state lives on. Getting the session state was easy, mark all classes that are stored in session and serializable and setup a sql server or a state service to persist the state. But getting the HttpApplicationState to stay in sync between the server is another matter. When the application loads it fills the AppState with some variables that may or may not change while the application is running. But if the variables change, they only change on the server that it was changed on, so client connected to the other server will not see the changes :S

One way I've though of is use the Cache instead and create a file dependency, touching the file each time the items change. But this would only work if all the servers shared a common share as the site root.  (which I was not able to do since IIS for some reason would not allow me to map the local path to a mapped network drive, don't know why)

Anyone found a way to keep the HttpApplicationState in sync across servers ?

Why can't we use a appstate_service to persist our application state, similar to what I've considered about caching out of process in asp.net

Posted: Jan 19 2004, 09:45 PM by oddurmag | with 3 comment(s)
Filed under:

Comments

AndrewSeven said:

You could look at the Configuration Management Application Block
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/cmab.asp


Does you CMS depend on Sessions?
# January 19, 2004 5:04 PM

Brian Desmond said:

Can you write your own Application State Provider? There are a bunch of providers for stuff like this registered in the machine.config.
# January 19, 2004 5:21 PM

Oddur Magnusson said:

nope, our cms system front end is not based on sessions as that would be a performance and scalability disaster. Although some of our advanced plugin modules make a modest use of sessions, we've triedto minimize that.

Our backend, where you login to actually edit the content and site structure requires the use of sessions.
# January 19, 2004 6:58 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)