Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to force a Heroku Dyno to sleep?

Tags:

heroku

dyno

I'm trying to debug an API issue I have that occurs when my app tries to access a sleeping Heroku Dyno. The problem is it takes a while for a dyno to naturally sleep so it really slows down the debug process.

I know how to turn off a dyno but the bug I'm try to fix seems to happen when the app makes a request to a sleeping dyno that doesn't immediately respond, yet eventually responds.

like image 977
jeffjv Avatar asked Mar 19 '15 22:03

jeffjv


People also ask

Do worker dynos sleep Heroku?

In addition to the web dyno sleeping, the worker dyno (if present) will also sleep. Free web dynos do not consume free dyno hours while sleeping. If a sleeping web dyno receives web traffic, it will become active again after a short delay (assuming your account has free dyno hours available).

Does Heroku go to sleep?

When Do Apps Sleep? When an app on Heroku has only one web dyno and that dyno doesn't receive any traffic in 1 hour, the dyno goes to sleep. When someone accesses the app, the dyno manager will automatically wake up the web dyno to run the web process type.

How do I turn off Heroku dyno?

If you wish to stop a running one-off dyno, use heroku ps:stop with its name. A one-off dyno will not stop if you issue heroku ps:restart on your application.


1 Answers

I got the definitive answer from a Heroku engineer. It's no, you can't force a dyno to sleep.

like image 132
jeffjv Avatar answered Sep 18 '22 08:09

jeffjv