I have a WCF application. I d like to keep this application live all the time.

If there is a certain period of inactivity, does IIS app pool recycles?

How do I keep it alive all the time?

Should i use a Timer?

I do have sensitive data within the application, and it takes time to populate it, that s why i like to keep it live all the time.


By default in IIS, the App Pool will recyle after 20 minutes of inactivity (idle timeout setting).

You can increase this (I belive setting it to 0 is the equivalent of setting it to never timeout).

However, I think you'd be better off to look at the overall situation, rather than simply adjusting the idle timeout on IIS.

How frequently is the service used? A few times an hour, a few times a minute, many times a second?
How many clients are connecting at the same time?
How long does it take to populate the data? Is the length of that initial load really enough to justify increasing the idle timeout? Etc.

Another option to consider if you want the service up all the time is to host it as a Windows Service. I've done that with one of my services where I needed to maitain a pool of objects.

Just some things to consider.

| improve this answer | |
  • Or caching the data out-of-proc using whatever mechanism they prefer. – vcsjones Aug 23 '11 at 20:06
  • if you have too much combinations, you can possible keep all the possible results in the memory, hence keep the result set in the memory and query it. – user30597 Aug 23 '11 at 20:25
  • Yes - just turn off the Idle timeout in the Recycling settings for the app pool. Also disable the 29 hour default recycle. This won't prevent all recycling (eg if the pool fails), but it will stop IIS stepping in unless the app breaks. – TristanK Aug 24 '11 at 3:03

You could always create a self hosting WCF service and avoid IIS altogether

| improve this answer | |
  • fyi: Authentication and Authorization code may change when porting from IIS-integrated to self hosted WCF. – goodguys_activate Sep 1 '11 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.