/dynosched

A small node.js utility to scale Heroku dynos up or down through the use of a scheduler

Primary LanguageJavaScriptMIT LicenseMIT

Dynosched

Build Status Codacy Badge Coverage Status

This script uses the Heroku Platform API to scale your Dyno formation up or down. All you need to do is to schedule jobs using the Heroku Scheduler (free!) and set up some env variables. Really handy to keep costs to a minimum (e.g. turn off my dyno at 8 pm and back on again at 7 am next day).

Instructions

1. Set the env variables below using heroku config:set MY_HEROKU_API_TOKEN=***

MY_HEROKU_API_TOKEN=****
APP_NAME=my-app-name
DYNO_TYPE=web
WEB_HIGH=1 // maximum number of processes
WEB_LOW=0 // minimum number of processes
SCALE_DOWN_AT=19 // the hour to scale down your dyno formation in your timezone
TZ='Australia/Sydney'

2. Configure the heroku scheduler add-on to run dynosched

https://devcenter.heroku.com/articles/scheduler

Enjoy!