0

I need to run a program that warm up my app. Is there some way to schedule that whenever iis recycle?

I'm using IIS 7.5.

Túlio Calazans
  • 179
  • 2
  • 15
  • You can schedule a task that listens for an event, assuming IIS does log events when it recycles the app-pool – rene Nov 05 '14 at 13:05
  • Thanks, I did something similar to that using a event listener: http://dotnetspeak.com/2014/01/detecting-app-pool-recycling-and-mitigating-its-effects – Túlio Calazans Nov 05 '14 at 16:08

1 Answers1

2

If you have a batchfile or exe that does the warming up you can schedule it as follows for a manual issreset

execute on ONE single line on a commandprompt:

schtasks /create 
         /tn warmup-app 
         /tr drive:\path\warmup.cmd 
         /sc ONEVENT 
         /EC System
         /MO *[System/EventID=3201]

and if executed you're greeted with

SUCCESS: The scheduled task "warmup-app" has successfully been created.

Now configure IIS to log it's apppool restarts in the EventLog:

enter image description here

rene
  • 41,474
  • 78
  • 114
  • 152