1

Let's suppose I have an ASP.Net web application hosted by IIS. In addition to the functionality serving requests I added an action executed periodically on specified interval, e.g. every 30 minutes. This action is not related to external web requests, for example, its purpose is deleting useless log files.

The question is: if nobody comes to my web site for long period of time (day, week) will IIS still keep my application alive and the above action will be executed every 30 min. Or IIS will shut down/suspend activity of the application if there are no requests for long time?

Perhaps it is a lame question but I failed to find the definite answer.

3
  • 3
    How do you execute an action every 30 minutes? Commented Sep 26, 2013 at 14:04
  • Your extra action should probably be something scheduled to run as a Windows background process/service, not part of IIS or an IIS web application. Commented Sep 26, 2013 at 14:22
  • @Derek I thought about this but amount of work and importance of this functionality is rather low. I was not sure whether it worths a separate dedicated Windows service. Commented Sep 26, 2013 at 14:29

1 Answer 1

2

IIS doesn't shut down, but IIS will recycle your app after a certain period of time of unuse.

So if your app is responsible for firing off the event, then no it won't run if your app is not running (recycled).

Either have a service hit your website once in awhile or setup a scheduled task on the server if you have access to the machine.

If you're on shared hosting you'll have to check their features to see if they have something like that.

Also, if you're just trying to delete log files or something trivial and not time sensitive (since you won't have logs unless someone is hitting your site), you could just perform your action in Application_Start. This even will fire whenever IIS restarts your application.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for pointing me to the right direction. I googled for 'iis application recycling' and it seems to be exactly what I was looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.