Heroku app idling with SIGTERM

I have a Java app running on Heroku with some Web jsp pages and a scheduler that runs in the background. Every now and then the scheduler jobs don't seem to execute. When I look at the Heroku logs, I see the following message:
Heroku logs
2011-05-30T19:11:09+00:00 heroku[web.1]: Idling
2011-05-30T19:11:17+00:00 heroku[web.1]: Stopping process with SIGTERM

From what I understand the application is going to sleep for some reason. When I open any Web page from my app, the logs show that the app is going alive again, and then scheduler starts working again as well.
graham on 14-02-2013 10:38
The reason of the app going to sleep was that with I am running a free version of Heroku with one web dyno and no worker dynos. The scheduler is running on the web dyno. However, the default behaviour in Heroku is to put all web threads to sleep if they haven't been called for an hour.

If my web dynos go to sleep, the scheduler stops working as well.

There can be a few solutions for this:
- you can add a free Heroku "scheduler" add-on that will ping your app at certain intervals
- you can use an external service like Pingdom to call your web app every once in a while and keep it alive
- you can switch to a paid version of Heroku and move your scheduler to a worker dyno
graham on 14-02-2013 10:43

Post an answer

Do you have a solution to this problem, or want to comment on it? Other users will appreciate your help!
Your answer or comment:
Show formatting hints
HTML is disallowed, but in your text you can use the following markup
  • [code][/code] for a block of code
  • [tt][/tt] for inline code
  • [link]link href|link anchor[/link] for links
  • [b][/b] for bold text
+ Ask a question
If you have a technical question related to programming and computers, ask it here. Other users will help you solve it!
Unanswered questions
Share your knowledge by helping others solve their problems