herokudyno

Heroku Dyno Usage 2 Workers


How are free dyno hours consumed? I have only one script hosted on Heroku, a discord bot, but it has 2 workers running on it. It used up all of my free hours well before I expected it to. When a script has 2 workers running on it, does it consume more hours than if it only had 1?


Solution

  • According to Heroku As of writing this you personal accounts are given a base of 550 free dyno hours each month. In addition to these base hours, accounts which verify with a credit card will receive an additional 450 hours added to the monthly free dyno quota. This means you can receive a total of 1000 free dyno hours per month, if you verify your account with a credit card.

    You can view how many free hours you have remaining with the heroku cli:

    heroku ps -a <app name>

    An app actively consumes free dyno hours if the app is set to use free dynos and any of the following are true:

    If an app has a free web dyno, and that dyno receives no web traffic in a 30-minute period, it will sleep. 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.

    This means if you have two worker dynos running 24/7 they will consume 48 hours every day. In a 31 day month there are 744 hours meaning with a single worker dyno you will be fine to run it 24/7 if you have a registered credit card but if you have two worker dynos this will not work as you will need 1488 free hours.