Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • caio 3 posts 23 karma points
    May 15, 2013 @ 19:01
    caio
    0

    If the app pool stops, when my scheduled task will run again?

    Hi,

       I've set up a scheduled task to hit a page every minute and I'm trying to figure out when my scheduled task will run again after the app pool has stopped and started again.

      I tried killing the app pool a few times in a row and I got unexpected results:

      Killed: 17:39:35  Restored 17:39:45  Task Run: 17:40:10

      Killed: 17:41:00  Restored 17:41:15  Task Run: 17:41:36

      Killed: 17:42:30  Restored 17:42:40  Task Run: 17:42:52

      After this initial run the logs show me that it runs correctly every minute as it should.

      My ultimate goal is to set this task to run every 24 hours, so if I can't make sure my app pool will be running for at least 24 hours, can I be sure the task will run at least once when the pool has started again?

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 15, 2013 @ 21:58
    Jan Skovgaard
    0

    Hi caio and welcome to our :)

    I belive you should able to rely on the task running in the chosen interval if you make sure the app pool is not stopped at any given point.

    Don't know if it would perhaps help to recycle the app pool at a certain interval and how it will perhaps affect the scheduled task though.

    /Jan

  • caio 3 posts 23 karma points
    May 15, 2013 @ 22:41
    caio
    0

    Thanks for your reply!

    The thing is I can't raelly make sure the app pool won't stop but I need to be sure the service will run at least once a day. It's not a big issue if it runs more frequently than once a day, it's just a waste. I am trying to understand how the scheduled tasks work. I guess what im tring to find out is if my scheduled task interval is bigger than the period the app pool is running, will my task ever run?

  • caio 3 posts 23 karma points
    May 17, 2013 @ 15:16
    caio
    0

    So I managed to run a few more tests. I set up my task to run every 5 minutes, and the Pool timeout for 20.

    I found out that when the app pool dies, the Scheduled Task ran once after it had been restarted (between 10-60 seconds) after it had been restarded, and after that consistently every 5 minutes, until the pool dies. I left my machine runnign these all night long and this happened every single time. It seems I can rely on it to run my task once as soon as the app pool is restarted, and then after the set interval.

    Any suggestions on how I can find out if this is realy the expected behavior?

Please Sign in or register to post replies

Write your reply to:

Draft