4

like the title shows I want to know what is the difference between "InProc" & "stateServer" mode in SessionState on ASP.NET.

Thanks

Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174

3 Answers3

9

In InProc mode, a live Session object is stored in RAM in the ASP.NET worker process (aspnet_wp.exe). It is usually the fastest, but more session data means the more memory is used on the web server, and that can affect performance.

In StateServer mode, each session is converted to XML (serialized) and stored in memory in a separate process (aspnet_state.exe). This state Server can run on another machine.

ASP.NET Session State FAQ

Anthony Faull
  • 17,549
  • 5
  • 55
  • 73
  • Cool - deleted my comment - ok (and I know its too late) the key difference between in-proc and anything else is that in-proc is tied to a single instance - fast but not scaleable - whereas the others trade performance for scaleability as multiple instances of the same web application (on one or more servers) can share the same state. – Murph May 25 '10 at 17:16
5

This MSDN article covers SessionState in detail.

etc
  • 622
  • 4
  • 10
3
  • Off - Used to disable sessions on website.
  • InProc - Sessions are stored inside of application's process on web server. Depending of IIS version used that could be aspnet_wp.exe or w3wp.exe.
  • StateServer - Sessions are stored using State Server windows service.
  • SQLServer - SQL Server database is used to store sessions' data
  • Custom - Manage session state using custom session state provider. Storage could be anything you implement in provider.

To specify session state mode in web.config, select one of these values for sessionState mode parameter:

In web.config file, <sessionState> element is located under <configuration>, <system.web> element.

wkl
  • 1,896
  • 2
  • 15
  • 26
jishan siddique
  • 1,848
  • 2
  • 12
  • 23