views:

233

answers:

1

I have an asmx web service and I load bunch of system data to internal data structures. This system data is used to check the validity of requests. However when there is no requests for say 3 hours (maybe less) the initializations are done again. The object that serves the requests has

private static bool _initOk

variable that controls the initialzation. When application is idle the variable is set to false. Is it because IIS stops the execution and dll containing the code is unloaded or something? If requests arrive on steady interval the initializations are not done again. Is there anything I can do about it?

Thanks!

br: Matti

+6  A: 

It is a setting of the application pool (found under IIS Manager), whether to stop the process, when it is iddle for a period of time, or wether to restart (recycle) it when certain conditions are met.

On each restart of the process, your initialization will be done again.

treaschf
thanks! I found a setting:Application Pool->Performance->Idle timeout->Shutdown worker processes after being idle of (time in minutes). So unchecking this should do (?)
matti
You should uncheck this, and also uncheck on the next tab the options for recycling the application pool.
treaschf
cheers! i hope this other option (recycling) will finally do the trick. Application Pool->Performance->Idle timeout->Shutdown did not help since the process was recycled after a period of time...
matti