views:

426

answers:

5

We currently have an ASP.NET Web Application running on a single server. That server is about to hit the danger zone regarding CPU usage, and we want to deploy a second server.

What would be the best way to handle Session State?

We currently run InProc. But that's not an option with 2+ servers, as we want to exclude a single server from the WLB rotation sometimes to do maintenance work. Even though we use sticky load balancing, we would have to wait for all users to exit before we can exclude the server from the WLB rotation.

So I was looking at this MSDN page: http://msdn.microsoft.com/en-us/library/ms178586(VS.80).aspx

I guess my main question is: If we use the State Server mode. Can we ensure rendudancy by deploying the state server across two servers? To avoid having a single point of failure.

A: 

Use either Scale Out State server (faster better) or SQL State (slower simpler). But beware if you store any none serializable objects into Session state, because you'll get exceptions after migration.

Robert Koritnik
Also be aware that the Session_End in Global.asax does not fire in state server, which will break functionality if you have hooked into this event when using inProc.
RichardOD
A: 

Sql State server would be a better option: This link might help Sql State Server . I don't believe you can run state server across multiple machines.

TWith2Sugars
+1  A: 

If you want one of the standard options I'd use SQL Server in a failover cluster. BTW have you consider memcacheddb?

RichardOD
Please tell me more about memcached?
MartinHN
Martin sorry I meant memcachedDB, though you can get memcached to replicate it is not easy- read about it here: http://memcachedb.org. You'd have to check whether the memcached provider works with it (it should)- http://www.codeplex.com/memcachedproviders.
RichardOD
Oh. That looks "use on your own responsibility - we don't provide support or guarantee anything".
MartinHN
That's why I also suggested SQL Server failover cluster, though that option comes with a cost (which may or may not be acceptable). I used SQL Server session state in a previous Web app and it wasn't fast, from memory I think around 25% slower, but that will depend how complex your types are.
RichardOD
Ok. So it seems like SQL Server statemode is the only way to get redundancy, and ensure seamless maintenance updates of our application.We store quite a few datatypes in session. We need to refactor some code in order to make it work with a State Server. Thanks.
MartinHN
A: 

Simply not.

Giulio Vian
A: 

you might want to look into project velocity (http://msdn.microsoft.com/en-us/data/cc655792.aspx) . It has limited support now because it is on CTP3 but later this year it would be RTM. I highly suggest you watch the MIX09 session about it here

Mohamed Osman