Thursday, June 2, 2016

Advantages and Disadvantages in Using ASP.NET Session State Server

About ASP.NET Session State Server

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, 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.

Advantages and Disadvantages in Using ASP.NET Session State Server

Many articles are discussing about advantages of using Session StateServer or SQLServer over InProc Mode.  One basic reason why I choose StateServer Mode is when your website is running on Third Party Hosting than you will notice that Session Timeout can occur anytime depends on load of traffic on your server. If your website has large number of visitors and session timeout can cause problem, It is better to change Session Mode Session="InProc" to Session="StateServer".

The following are the canonical analysis of the pros and cons of Using ASP.NET Session State Server:
  • In process
    In process will perform best because the session state memory is kept within the ASP.NET process. For Web applications hosted on a single server, applications in which the user is guaranteed to be re-directed to the correct server, or when session state data is not critical (in the sense that it can be re-constructed or re-populated), this is the mode to choose.

  • Out of process
    This mode is best used when performance is important but you can't guarantee which server a user will request an application from. With out-of-process mode, you get the performance of reading from memory and the reliability of a separate process that manages the state for all servers.

  • SQL Server
    This mode is best used when the reliability of the data is fundamental to the stability of the application, as the database can be clustered for failure scenarios. The performance isn't as fast as out of process, but the tradeoff is the higher level of reliability.


The out-of-process (aka "StateServer") and SQL-Server options both survive web application restarts (including application pool cycling) and both make session data available to multiple servers in a cluster / farm.

Finally, it may go without saying, but the basic in-process setup is the easiest to configure, which is a meaningful "pro" in many environments.

Tim Sneath's ASP.NET Session State: Architectural and Performance Considerations adds some additional information, and the MSDN topic on Session State Modes is a reliable, up-to-date source.
Tags: , , , , ,

Written by

We've been a trustworthy web hosting review site, and have reviewed 350+ web hosts since 2008 - focusing on helping developers, bloggers, freelancers and small business owners to pick up the right web host based on the budget and requirement, including shared web hosting, cloud hosting, reseller hosting and dedicated servers.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.

 

About Us

WindowsHostingBulletin is a professional windows hosting review website to help people find the best windows hosting at the lowest price available. We receive compensation from the web hosting companies whose products we review, though this has no impact on the quality of our reviews.
Copyright © Best ASP.NET Hosting Reviews | Designed by WindowsHostingBulletin.com