So I have deployed a telegram bot through Heroku. For now I have 550 hours (I have only this app). If i verify my credit card I can get a total of 1000 hours. So... with one app and 1000 hours my app will be forever online right?(excluding the sleeping after 30 minutes, but with Kaffeine I think that I can make it forever online). Just to be sure... I know that after a 30 minutes of inactivity the app will sleep. So even if I use the bot for 1 sec it will consumes 30 minutes; if one user uses the bot at 15.30 and another one at 15.40, it will consume 30 minutes or 60 minutes?
Heroku charges by wall-clock time, so for all minutes your dyno is up.
When a request comes at h14:00 the applications starts, shutting down at h14:30 if there is no further usage after that single request, total 30 min
When a second request comes at h14:15 the application is already up and running, shutting down at 14:45 if there is no further usage after the second request, total 45 min
During the activity (which you are charged for) the app can serve multiple requests without incurring in additional costs.
Related
According to heroku
Starting today, Heroku accounts have an account-based pool of free dyno hours for use on free apps. This replaces the 18 hours a day limit on free apps, allowing a free app to run 24/7 if needed. New accounts receive 550 free dyno hours and you can verify your identity with a credit card for an additional 450 hours
→ How are dyno hours calculated
If my app is always up, how many days will it stay up for (If I have 550 dyno hours) or does it depend on traffic and usage?
An app consumes hours based on their uptime, no matter the usage or traffic your app receives.
If you do the math, 550 hours is equal to 22.92 days.
If you were to add your payment method, it would give you a thousand hours, enough for a single app to run 24/7.
I have a question about running my Twitter bot 24/7, and I already have it uploaded to Heroku. The code works great.
However, the dynos will fall asleep after 30 minutes of non-use. This is great, however, my code is programming to tweet the same thing once a day.
In order to keep the dynos alive, the code has to be run every 30 minutes. The tweet, however, is the same thing once a day.
Is there a way to keep the Twitter code running when receiving a duplicate?
It seems like you want to bypass the limit, but that is not possible. if you keep running that service all day your free hours will expire.
Verified accounts come with a monthly pool of 1000 Free dyno hours; unverified >accounts receive 550. When a Free dyno is active, it draws from the pool; your free >apps can run as long as there are dyno hours left in your monthly pool.
instead, better to upgrade the Heroku to the premium version.
I need to be able to run my Heroku app 24/7 even when no one is currently viewing it. It's primarily a server side application that I need to constantly be running at all times.
What's the cheapest and best way to go about doing this. I don't mind paying as long as I'm not paying unnecessarily.
Thank you.
You have three options:
Hobby subscription
Free Web Dyno
Free Worker Dyno
(1) Go for the Hobby subscription: 7$ per month, the Dyno is 24/7 up and running
(2) Use the Free tier, register a valid credit card which gives you extra free Dyno hours (total of 1000 hours) and make sure the Dyno is always up.
The Free Web Dyno sleeps after 30 min inactivity (ie no incoming requests for 30 minutes): you can prevent this sending a request (from an external tool or script) every 20 min.
(3) Use the Free tier (again register a valid credit card to be eligible to 1000 free hours) with a Worker Dyno only (free worker dyno do not sleep)
More info at Free Dyno Sleeping
So I currently have a Java Spring Boot app deployed on Heroku and is the only dyno I have deployed on the account. I had made a call to it and it started up the server but then immediately logged ~1.2 hours off of my free dyno hours. I only had it open for ~10 minutes and then with the added 30 minutes to go to sleep it should only have logged 40 minutes. Is it possibly because it is making multiple calls to the same dyno that it is spinning up multiple thread and then charging double? What causes this?
If I only have one active app is it possible that it could spend all free Dyno hours quota?
My app is a PHP process which is always active (while (true) { do_something}). I launch this process as a worker.
I thought the free Dyno hours quota were like real hours so you can spent 24h as max per day. But if I view my remaining free hours quota in two consecutive days using 'heroku ps -a app' command then I get that I am spending more than 24h per day.
Another question, how many hours do you have in a Hobby plan?
If you are running 2 dynos (for example, a web dyno and a worker dyno), they will each use 24 hours, for a total of 48 dyno hours used in a day. Of course in reality it would probably be less than 24 hours each, if the dynos slept for part of the day.
I solved my problem disabling the web Dyno.