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.
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).
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.
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.
I got the definitive answer from a Heroku engineer. It's no, you can't force a dyno to sleep.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With