Click here to Skip to main content
14,297,726 members
Rate this:
Please Sign up or sign in to vote.
See more:
I'm using a job scheduling app using Hangfire and it relies upon a website built in ASP.NET. The problem is that when I leave the website idle for 12 hours or so the Hangfire jobs no longer (it is a text messaging system) process. Finally, when I launch the website by accessing it through https://www.CrudibleTARS.com, the website appears to "wake up" and the jobs process properly.

My question is this: Even thought IIS 10 is showing that the website is "started" the jobs do not process. So, does a website "go to sleep" after a period of inactivity? Is there a way to stop this if so?

I would have asked this on the the Hangfire site but they do not answer questions in a timely manner, if at all. In any event, this is not a Hangfire problem this is IIS 10 ... website status problem/question.

Thanks,
C. T. Blankenship

What I have tried:

Restarting the website ... injecting four records into the messaging database table ... and noticing that the jobs do not execute.

Then, I launched the website using Google (not IIS on the server) and the jobs execute.
Posted
Updated 28-Jul-19 11:25am
Comments
Richard MacCutchan 28-Jul-19 14:15pm
   
Since we have no idea how your application uses the website it is impossible to suggest anything.
Charles T. Blankenship 28-Jul-19 14:30pm
   
Impossible ... not so much ... but thanks for commenting.
Charles T. Blankenship 28-Jul-19 14:24pm
   
I think this solution should work just fine ... Changing IIS to Not Stop Worker Process in IIS 7.0+ I'll keep this thread updated with regards to this possible solution.

C. T. Blankenship
Charles T. Blankenship 28-Jul-19 14:29pm
   
This link is the solution to the problem I believe Changing IIS to Not Stop Worker Process in IIS 7.0+ in the previous comment the link was incorrect.
Charles T. Blankenship 28-Jul-19 20:26pm
   
I installed SmarterPing (http://www.smartertools.com/Products/SmarterPing/Default.aspx) and set it up to ping my website every 10 minutes. The installation was not without events though. I had to set it up to emulate Windows 7 and to run the .exe as Administrator. Thanks so much to all of you for offering your insights. There is one problem with using the application though. It is no longer supported by SmarterTools. If you have a problem you are on your own. I'm glad I figured it out as my first attempt to install the application failed.

Thanks!

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

This does happen in IIS, and the simplest way of solving this can be to ping your application at constant interval of time if you want to keep the application active.

Another way of handling this problem is by changing the idle time in the application pools, see this thread for more on that, Preventing IIS from "falling into sleep"[^]. This is the efficient way of handling the problem, since you can handle it from the control panel without having to add an extra service in the game.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100