Last post Feb 14, 2011 04:36 AM by shyam_oec
Feb 09, 2011 04:22 AM|prabodhm|LINK
I have a Web Farm environment. I want to use the Use the StateServer mode for storing my session state.
I've taken care that the objects stored in session are all serializable.
I want to know, how does StateServer mode take care of memory management.
If I add any object to Session, when will it be removed? Will it cause any over heads to my server hosting the state service?
Feb 09, 2011 06:31 AM|farukinfo|LINK
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.
For more details go through the link below:
Feb 09, 2011 06:38 AM|bala.sekhar|LINK
Incase of state server objects are serialized and written to disk. It is ASP.Net State Service which is hosted on the state server will take care of managing the memory.
This will not have any bearing on the website hosting server.
The advantages of the StateServer mode are as follows:
Session storage is out-of-process, so it does not directly impact the scalability of the ASP.NET application.
You can share session items across multiple Web servers.
The disadvantages of the StateServer mode are as follows:
There is a high performance cost of marshaling session items across processes, even within the same server.
There is a high performance cost of marshaling session items between servers if you have multiple servers accessing the same state service.
Session items are not durable. You will lose them if the dedicated process crashes or is restarted.
Session items must support binary serialization to work with the StateServer mode. Popular objects such as the DataSet object do support binary serialization. However, others such as the equally useful DataView object do not.
Feb 09, 2011 07:01 AM|prabodhm|LINK
I have read that there is an overhead of 15% to access the data from State Server, and that for SQL Server is 25 % plus the Serialization cost.
I will be reviewing the impact of these costs on the performance, however i am more concerned about the memory management part.
What if I do not explicitly clear the session objects? If the ASP.NET State Service manages the memory by itself, what algorithm will it follow? will it be FIFO? when will the removal of objects take place? will this have affect on the performance of the
server hosting the service, as I am planning to host the server on one of the application servers.
I did not find anything related to this on the internet. Any links, blog posts will be really helpful.
Feb 11, 2011 03:21 AM|Wenchao Zeng - MSFT|LINK
I think the memory management part is the same as the in process session state. The only difference is the data is serialized to be transferred between the service and your web site.
The data will be clear when the user is inactive for an amount of time. We can set the value in web.config file:
Hope this helps.
Feb 14, 2011 04:36 AM|shyam_oec|LINK
Please visit this