Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from Aug 23 '11 at 19:54

This question came from our site for professional and enthusiast programmers.

this may be helpful:… but make sure there are no memory leaks anywhere :) – Can Poyrazoğlu Aug 23 '11 at 19:52
only other option would be self-hosting (for example in a Windows Service) - then this would be totally up to your code... – Yahia Aug 23 '11 at 19:58
up vote 7 down vote accepted

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.

share|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

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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