Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep a WCF site online?

Tags:

iis

wcf

I have an WCF site on IIS 7. The site is rarely being accessed which causes the application to unload. How can I keep the application (WCF) up all the time?

like image 706
Eran Betzalel Avatar asked Nov 13 '09 22:11

Eran Betzalel


1 Answers

There's no reason to stop using IIS. All you need to do is set the application pool options so that the service is never shutdown due to inactivity. Unfortunately the defaults are something like 20 minutes of inactivity and every 29hrs regardless.

What I would suggest is:

  1. Create a new application pool just for your service.
  2. Once created, right click on it and choose "Advanced Settings..."
  3. Look for the "Idle Time-out (minutes)" setting under the "Processor Model" group. Change this setting to 0 to have the service never shut down due to idling.
  4. Consider changing the "Regular Time Interval (minutes)" setting under the "Recycling" group as well if you do not want the process to be recycled. You can either set this to some number of minutes (as I said it's 29hrs by default) or you can set this to 0 and instead configure the "Specific Times" setting so that your service is recycled at optimum times of the day (say, 4AM or something). If you run a web farm you would configure the farm to recycle in a staggered way so that at any given time only one server is recycling.

Fun trivia: the reason the default recycling is 29hrs is because this will cause a recycling every day, but 5hrs later each day so that the time of day is never the same.

For more on configuring application pools, check out this section on TechNet titled Managing Application Pools which covers the topics I've mentioned above as well as many others.

like image 94
Drew Marsh Avatar answered Nov 07 '22 13:11

Drew Marsh