Visual Studio .NET - Tell in inproc and Outproc session state managemenet and what 's thedifference between them

Asked By chitanya chitanya on 21-Jan-07 11:38 PM
end of post

difference between in-proc and out-of-proc - K Pravin Kumar Reddy replied to chitanya chitanya on 21-Jan-07 11:51 PM

What is the difference between in-proc and out-of-proc?
An inproc is one which runs in the same process area as that of the client giving tha advantage of speed but the disadvantage of stability becoz if it crashes it takes the client application also with it.Outproc is one which works outside the clients memory thus giving stability to the client, but we have to compromise a bit on speed.

InProc / OutProc comparison - mv ark replied to chitanya chitanya on 22-Jan-07 01:19 AM

In case of InProc, state is maintained within the managed memory of the ASP.NET process whereas in case of OutProc mode session is managed by an external resource ( StateServer or SQL Server )


This EggheadCafe article - http://www.eggheadcafe.com/articles/20021016.asp has a good comparison

Storage location

    * InProc - session kept as live objects in web server (aspnet_wp.exe). Use "cookieless" configuration in web.config to "munge" the sessionId onto the URL (solves cookie/domain/path RFC problems too!)
    * StateServer - session serialized and stored in memory in a separate process (aspnet_state.exe). State Server can run on another machine
    * SQLServer - session serialized and stored in SQL server

Performance

    * InProc - Fastest, but the more session data, the more memory is consumed on the web server, and that can affect performance.
    * StateServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 15% slower than InProc. However, the cost of serialization/deserialization can affect performance if you're storing lots
      of objects. You have to do performance testing for your own scenario.
    * SQLServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 25% slower than InProc. Same warning about serialization as in StateServer.

Robustness

    * InProc - Session state will be lost if the worker process (aspnet_wp.exe) recycles, or if the appdomain restarts. It's because session state is stored in the memory space of an appdomain. For details, see KB324772.
    * StateServer - Solve the session state loss problem in InProc mode. Allows a webfarm to store session on a central server. Single point of failure at the State Server.
    * SQLServer - Similar to StateServer. Moreover, session state data can survive a SQL server restart, and you can also take advantage of SQL server failover cluster, after you've followed instructions in KB 311029.