Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between inproc and outproc [closed]

Tags:

c#

inproc

I am trying to find difference between inproc and outproc in c#. If I have a dll running on the server and my question is will it run in both inproc and outproc? Performance-wise which process is better?

like image 401
manjuvreddy Avatar asked Jul 23 '13 18:07

manjuvreddy


People also ask

What is InProc mode in session?

InProc session mode indicates that session state is stored locally. This means that with InProc session state mode is stored as life objects in the AppDomain of the Web application. This is why the session state is lost when Aspnet_wp.exe (or W3wp.exe, for applications that run on IIS) or the AppDomain restarts.

What is Outproc session?

Outproc session state This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm. Calling an outproc server , data needs to be marshalled across the process boundry which is an expensive operation.

Where Outproc session are stored?

By default, sessions are stored in-proc (in-process); i.e. in the memory of the Web Server.


2 Answers

An inproc server runs in the same process as the calling application. It's close to a normal function call on a dll. Calling an outproc server, data needs to be marshalled across the process boundry which is an expensive operation. An inproc server is fast but it can bring down your application.

like image 86
tzerb Avatar answered Oct 08 '22 19:10

tzerb


From MSDN

ASP.NET session state supports several different storage options for session data. Each option is identified by a value in the SessionStateMode enumeration. The following list describes the available session state modes:

InProc mode, which stores session state in memory on the Web server. This is the default.

StateServer mode/OutProc, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

SQLServer mode stores session state in a SQL Server database. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

Custom mode, which enables you to specify a custom storage provider. Off mode, which disables session state.

like image 13
Ehsan Avatar answered Oct 08 '22 19:10

Ehsan