Friday, August 12, 2011

When to use Inproc Session ? When to outproc session ?


in case of inproc session mode,  
1) session data is stored in current application domain... and so consumes memory of server machine (hampering the performence).
2) if server restarts, all session data is lost.
in case of out-proc mode (which is generally state server),
1) session data is stored on state server and so web servers memory is not consumed
2)in case of web server restart, session data is preserved.
considering above points, use of session mode is the choice to be made considering load, no of users, performence requirment etc.
for small web site with limited no. of users, in-proc mode is best suited
for large applications with huge no. of users, state-server/sql server session mode should be used...

The basic necessacity of using the Outproc session is when you have deployed your application in web farm or web garden. Outproc session should be used when you expect issues like if you are modifying you web.config file or bin folder at runtime or IIS restart on server. As State server mode gives a advantage that it will not lose the data even if your application crash. InProc is the by default session mode in the asp.net apps.

No comments :

Post a Comment