B
Brian Schloz
Hello,
I just thought I'd share my particular situation regarding session
state periodically being "lost" in my asp.net app. I read with
interest all of the posts regarding lost session state (virus scanner,
modified assemblies/configs, etc.). The suggested solution of using a
'State Server' or 'SQL State Server' was not attractive to me given
the drawbacks: performance, objects must be serializable, no more
Session_End.
Perhaps the most helpful advice I ran across was to use Performance
Monitor (perfmon) to monitor various counters of the .NET processes.
So, I setup perfmon and added all sorts of counters. The two counters
that led to my solution were: Application Restarts and Compilations
Total. After a period of monitoring I noticed that 'Compilations
Total' would hit a threshold and kick off an Application Restart
(which in turn caused anyone in my app to lose their session state).
After careful review of the machine.config file, I found the culprit:
numRecompilesBeforeAppRestart="max number of recompilations before
appdomain is cycled" // Default: 15 recomplations
If I increase this number to say "9999", I never run into the lost
session state. However, I am concerned about this solution given by
the fact that the default value is so low (15 - why????). Unless
someone can point out the reason this may be a bad fix, I will happily
continue forward (my users are happy now too).
Brian Schloz
Lead Software Engineer
JHOB Technologies, LLC
I just thought I'd share my particular situation regarding session
state periodically being "lost" in my asp.net app. I read with
interest all of the posts regarding lost session state (virus scanner,
modified assemblies/configs, etc.). The suggested solution of using a
'State Server' or 'SQL State Server' was not attractive to me given
the drawbacks: performance, objects must be serializable, no more
Session_End.
Perhaps the most helpful advice I ran across was to use Performance
Monitor (perfmon) to monitor various counters of the .NET processes.
So, I setup perfmon and added all sorts of counters. The two counters
that led to my solution were: Application Restarts and Compilations
Total. After a period of monitoring I noticed that 'Compilations
Total' would hit a threshold and kick off an Application Restart
(which in turn caused anyone in my app to lose their session state).
After careful review of the machine.config file, I found the culprit:
numRecompilesBeforeAppRestart="max number of recompilations before
appdomain is cycled" // Default: 15 recomplations
If I increase this number to say "9999", I never run into the lost
session state. However, I am concerned about this solution given by
the fact that the default value is so low (15 - why????). Unless
someone can point out the reason this may be a bad fix, I will happily
continue forward (my users are happy now too).
Brian Schloz
Lead Software Engineer
JHOB Technologies, LLC