A test WCF webservice that I have hosted using IIS 7.5 is consistently slow to respond to calls made after a period of inactivity (i.e. the first call of each day).
From researching this topic I gather that the problem of "application warmup" is commonly encountered when using IIS (e.g. see here).
I have taken the usual steps that are recommended to try and mitigate this problem:
- Installed the Application Initialization Module.
- Disabled the application pool Idle Time-out, and the Regular Recycling Time Interval (i.e. set them to '0').
- Edited the
applicationhost.config
file so thatautoStart=True
andstartMode="alwaysRunning"
for the necessary app pool, andpreloadEnabled="true"
for my application.
With these settings, I expect the application pool to immediately spin up a worker process when IIS is started, and spin up a new worker process when the existing one exits. Also, I expect the application to be loaded within the worker process.
However, for the first call of each day, the logs show the difference in time between the client making a call, and the webservice receiving the call, can be as much as 10 seconds. Subsequent calls are typically handled in well under 2 seconds.
Curiously, the long response time is not reproduced by making a call following an iisreset
command. I would expect that such a heavy-handed operation would put the webservice in a similarly "cold" situation, however this does not seem to be the case.
I would like to know:
- What could still be causing the delay in the application "warming up"?
- What is the difference in the state of the webservice following
iisreset
and a long period of inactivity? - Should I resort to a "heart beat" solution to regularly ping the service to keep it alive?
Thanks in advance for any tips or insight.