Asp – Problems with ASP.Net State Service

asp.netsession-state

We have an ASP.Net 2.0 web application running in a web farm which is using the ASP.Net State service to store sessions.

We have been having problmes with the service intermittently and have changed a few things such as the machineKey in the machine.config.

My actual question is around the monitoring of the state service service. We have all 4 available performance counters running on the server that hosts the service and as yet we have not seen a single session time out. We have also seen the number of active sessions slowly rise over a period of time, but never become less.

Does the state service recognise when sessions time out? Is there something we should be doing manually?

Edit: We have given up on the state service and gone with SQL server sessions.

To answer the questions below, it seems that sessions go up forever until the service falls over and it is very doubtful that any oen threads are linked to the state server. This is a fairly basic web app at the end of the day.

It seems from the reading I am doing that anumber of other people have experienced similar things, but there seems to be a general lack of common sense and knowledge in any responses flying about.

MS seem to have almost no documentation on this topic.

Best Answer

In ASP.Net session time outs can be configured in web.config and machine.config. The default time out assuming nothing has changed will be 20 mins. The machine.config file can be set to not allow overriding, which means that any changes specified in web.config files will not override these settings.

Have you ensured that the appropriate settings are in place in both machine and web config files?

The state service should drop each session after 20 mins of inactivity assuming the default settings.

At what point are your inactive sessions dropped? I assume they are not exponentially increasing, unless your are restarting the service in order to clear them they must be being dropped at some point.