How FREE Heroku really works and how to get maximum from it?
Recently I’ve got a problem that Heroku stopped my sites (I’ve got 6) because I’ve had used all free dyno 1000 hours / month
It was very confusing for me WTF does this free dyno hours mean?
I couldn’t figure out it from the docs so after speaking for couple of hours with support I finally got it.
How does free Heroku works
- 1 acc = N apps (sites)
- Each app goes sleep (idle) after 30 mins if no usage
- 1 acc has 1000 dyno hours/mon
- 1 dyno hour = 1 hour site is online. Just anyone who will open your site makes it run again
- If you open site for 1 sec with 30 mins interval 10 times you will use 5 dyno hours
- To not make site sleep you can use site monitor like New Relic. It will check site availability by pinging it and will make it online each 15 mins (before Heroku will make it sleep). Here is the article on how you can setup it.
- No visitors limits
So I’m made one more free Heroku account and create only one site there + setup a monitor to avoid sleeping. In this case it will be online all the time and will use 744 dyno hours from 1000 available per month maximum.
Add custom domain + SSL for FREE
By default all Heroku sites have domain “https://name.herokuapp.com”. And you can also add custom domain for free. But you need to pay $7 / mon for Hobby Plan to have SSL certificate.
To get free SSL certificate for Heroku custom domain I’m using Cloud Flare. Also it will make cache static images which is pretty nice if you have a lot of them.
Is there is difference between paid and free Heroku plans?
So there is no difference between Free Heroku with 1 app + avoid sleep trick and 7$ Hobby plan. RAM amount in this 2 plans is the same. So no make sense to pay if you just started your side project and you need some free hosting. You could even make two free Heroku accounts as I did :D
What to do if your site is static?
Heroku is for dynamic sites. Dynamic means use some back-end like PHP, NodeJS, Ruby etc. If your site is static (just HTML, CSS, JS) for example your personal site there is no sense to use Heroku and spend this 1000 hours.
For hosting of static sites I’m using Netlify.
- Nice interface
- FREE SSL certificate
- Drag and drop source files for deployment
- No limits in hours
- Here is comparison with GitHub Pages
Hoping this article can help you with hosting of your side projects.
P.S. Thanks Fyodor Ivanischev for proof read :)
Recently I quit my job and I have one year to get to profitability
Want to see if I reach my goal?
And follow me in Twitter
And if you’re feeling really generous, you can buy me a pack of ramen by sending $2 to my PayPal address
or become my Patron