WCF Service 404 Error on First Post
I have a WCF Service hosted in IIS 7.5 that is responding to the first soap message posted to it after inactivity with a 404 Error.(It works around 15 seconds after that...it is likely waking up after that initial ping.) In investigating this issue I have: -Prevented App Pool Recycling by setting the Idle Time-out to 0 and the recycling time interval to 0 - Attempted to enable the app warmer by installing Microsoft's App Inititializer and amehrots app initializer ui for iis 7.5. Using this I set the application pool to always running and preloaded/preinitted my service. - Installed http://keepalive.codeplex.com/ to run through the metabase and hit the service with activity.
While the service is active following an iis restart, it still appears to sleep after a period of inactivity. I am currently looking into reliable sessions and whether tweaks can be made to the web.config. Any further guidance would be appreciated.
There is an idle time setting on the Application pool.
The default is 20 mins, if there is no Activity for 20 mins the app pool is released from memory. The first Call after that will trigger a load and JIT compile of the code.
You can stop the shutdown by setting the idle time to 0.
I decided to give up on my attempts at an elegant solution and ended up adding a windows service to send a web request to each of the urls that I needed to keep alive.