views:

482

answers:

4

Hi all, Where can you get information on the ASP.NET State Service e.g. how it works, performance, behaviour characteristics etc. Have looked on internet but cant find in depth information or an article dedicated to the subject. Thanks

+1  A: 

Programmatically, session state is nothing more than memory in the shape of a dictionary or hash table, e.g. key-value pairs, which can be set and read for the duration of a user's session.

Check following links for more details :

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

http://msdn.microsoft.com/en-us/library/ms178581(VS.80).aspx

Samiksha
+1  A: 

Consider to read a book: "Pro ASP.NET 3.5 in C# 2008" or "Pro ASP.NET 3.5 in VB.net 2008".

Aen Sidhe
+5  A: 

Which may or may not be of use to you..

In short, it works like this:

InProc Session State is the fastest, however it is also in-process, meaning it is not shared (read "no good for web farms"), and is lost if the process crashes.

State Service (aspnet_state.exe) is still pretty damn quick, but there is some overhead due to the marshalling between the worker process and the service itself. Can be good because IP addresses can be passed in the config, meaning it can run on its own machine. It is also out-of-process from the worker process, meaning it can survive a process crash. Since it can run on a single machine, state can be shared provided all clients use the same machine.

Sql Server (or another custom provider) - Tends (not always) to be the slowest of them all, especially due to what could potentially be a lot more disk I/O. However, this is also one of the more robust solutions since the state can be persisted to disk, meaning not only can it survive a process crash on the web server, but it can survive a server crash itself (once the DB is back online, the state is restored). Coupled with clustering this can provide a rock-solid session system.

Rob Cooper
Wow, bitter and funny.
Allain Lalonde
+1  A: 

You should also consider this when you handle sqlserver state

JSC