This add-on is operated by Riku Eteläniemi
Pay only for what you need.
Stop 'N Go
Last updated 03 November 2017
The Stop 'N Go add-on is currently in beta.
Table of Contents
Stop ‘N Go is an add-on that automatically stops and starts dynos in non-production Heroku apps to reduce costs. Adding Stop 'N Go to development apps can save your organization a significant amount of money.
Here’s some quick math to illustrate:
- Assume your development app is running on 1 Standard-1X dyno ($25 per month, prorated to the second).
- Assume your app is actively being developed for 12 hours a day, 20 days per month.
- Therefore, your development app needs to be active for about 12 * 20 = 240 hours per month.
- Assuming a 30-day month, this leaves 480 hours a month (about 67% of the month) during which your development app is running but receiving no traffic.
In the above example, using Stop 'N Go to automatically stop your development app during periods of idleness can result in savings on the order of $16.75 a month ($25 * .67) per application.
How does Stop 'N Go work?
Stop 'N Go adds a log drain to your development app. Your app sends a copy of its logs to the Stop 'N Go service, which monitors log timestamps.
Stop 'N Go stores only your app’s most recent log timestamp. It never stores log messages. Stop 'N Go does not maintain any timestamp history.
After 30 minutes of logging inactivity, Stop 'N Go saves the details of your app’s current dyno formation, then scales the formation down to 0 dynos.
When your inactive app receives an HTTP request or produces a log event, Stop 'N Go instantly restores the app to the dyno formation it had prior to being scaled down.
Do not use Stop 'N Go with production applications. The first request sent to an application with 0 active dynos produces an error, which can negatively impact your users or your other production apps.
Provisioning the add-on
Stop 'N Go can be attached to a Heroku application via the CLI:
A list of all plans available can be found here.
Provisioning with a default 30-minute timer
$ heroku addons:create stopngo -----> Adding stopngo to sharp-mountain-4005... done, v18 (free)
Provisioning with a non-default timer
$ heroku addons:create stopngo --timer=15 -----> Adding stopngo to sharp-mountain-4005... done, v18 (free)
The following values for the
--timer option are supported (all values are in minutes):
After you provision Stop 'N Go, it automatically starts monitoring your application’s log timestamps. At least the value of the
--timer option’s minutes must pass before Stop 'N Go stops an inactive app.
By default, applications are considered inactive after 30 minutes. You can change this via the dashboard, by accessing the add-on from the Heroku UI, or by using the options flag in the CLI.
Stop 'N Go servers and security
Stop 'N Go’s log receiver, custom error pages, and add-on admin dashboard are all hosted on Heroku. This guarantees minimal latency between your app and Stop 'N Go services.
All data pertaining to your app, including tokens, your application ID, and your log drain URL, are encrypted via the
Heroku’s log drain sends all log information to Stop 'N Go using HTTPS drains, meaning all log data sent by your app is sent securely.
When Stop 'N Go receives log events from your app, it updates the timestamp of your app’s latest log activity. It does not store log messages or any history of past log timestamps. Only the latest log event’s timestamp is retained.
Custom error page
Stop 'N Go adds an
ERROR_PAGE_URL config var to your application. If this config var already exists for your app, Stop 'N Go overwrites it. This allows Stop 'N Go to display a human-readable status page whenever a user tries to access your app while it’s inactive.
The custom error page monitors your app’s status. Once the app becomes active, the error page automatically refreshes the page to present the app.
A Heroku app’s status becomes
ACTIVE once its associated process has started. Depending on your app, it might take seconds or minutes for it to be ready to receive traffic. This might delay the error page’s refresh.
Stop 'N Go has no effect on your local development environment, because it only manages Heroku dyno activity.
Migrating between plans
heroku addons:upgrade command to migrate to a new plan.
$ heroku addons:upgrade stopngo:newplan -----> Upgrading stopngo:newplan to sharp-mountain-4005... done, v18 ($49/mo) Your plan has been updated to: stopngo:newplan
Removing the add-on
You can remove Stop 'N Go via the CLI:
$ heroku addons:destroy stopngo -----> Removing stopngo from sharp-mountain-4005... done, v20 (free)
All Stop 'N Go support and runtime issues should be submitted via one of the Heroku Support channels. Any non-support related issues or product feedback is welcome at email@example.com.
You can also receive service status updates and reach out to us on Twitter at @HerokuStopNGo.