Dyno Hours for paid account and Frequency to call app endpoint - heroku

I am new to Heroku, created an app and deployed on heroku free account. And I want use endpoint of that app as publicly accessible endpoint. In heroku documentation it is mentioned heroku API can be called for 4500/hour. I am confused that will this limitation will be applicable to publicly accessible endpoint also?
and how much dyno hours do we get for the standard account/paid account ?

The Platform API is meant for developers who want to programmatically manage the applications (create/destroy Dynos, etc...). Here the max 4500 calls per hour applies.
There is no rate limit on the endpoints (or applications) you develop and expose to the users. The only limitation is the quota in case you use the Heroku Free tier.
Paid plans do not have restrictions: Dynos are always running but they do restart every 24hrs anyway (see Heroku Restart policy)

Related

Heroku pipeline dynos and add-ons

I'm using Heroku's Pipeline feature to manage the stages of my application. I received an email about Heroku getting rid of their free plans, so I went ahead and upgraded my plan just now. Currently, I have one app with two database add-ons in Heroku. This is the first time that I've used their Pipeline feature—and I'm by no means a Heroku expert. I have two questions:
Do I need to purchase dynos for every new app that I use Heroku for? The plan that I ended up purchasing was the Production plan (since the app is for a client), and I also purchased two psql database add-ons which are attached to the app.
Since I'm using their pipeline for my one app, I have staging and prod versions of the app assigned to their appropriate branches in the repo. The prod app is where I upgraded to the paid plan. Do I need to purchase any dynos or add-ons for the staging app within the Pipeline? I was able to attach the databases with no issue, but I purchased a dyno for the staging app just to be safe.
Feel free to share any of your favorite Heroku alternatives as well—I'm only using Heroku because that's what I learned how to use in school.
Fellow Heroku user here!
Do I need to purchase dynos for every new app that I use Heroku for?
Yes. Heroku have basically said they’re getting rid of free plans for all applications due to wanting to make more money security reasons. So staging apps will also fall under this.
Basically, it sounds like there’s going to be no free tier dynos or first party add-ons from Heroku going forward. They do suggest for non-production apps (like testing and staging apps) to turn your dynos on when in use, and off when not in use, and you’ll only be billed for the time the dyno is on.
I‘m not sure which plan is the Production plan (I couldn’t see it on the pricing page) but maybe try out Hobby first. I have multiple apps running with paid Hobby-tier dynos and they have ran just fine without really spiking the CPU or memory available in those dynos. But I’m running PHP apps, so your milage may vary if you’re using another tech stack, or do get more load than my apps.

How to implement auto stop for iddle or inactive applications on Google cloud platform like Heroku does?

Classic approach on GCP is rent a linux host with static monthly payment. It doesn't matter if your application is not running or users aren't consuming it, you will always pay the static monthly payment. I think this is acceptable for production environments but for development and testing not.
This does not happen on Heroku :
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.
Question
How stop or delete app on google (gae, cloud run, cloud build, containers) if does not receive web traffic?
If it is possible using just google tools it would be great:
https://cloud.google.com/products
Idea
Developing a basic router with nodejs which works as minimal balancer. If web traffic is not detected for some apps, an instruction to google cloud platform api could stop the app or container. This would also apply to other clouds.
Any help is appreciated.
Update
I cannot find any solution yet. I will try to add that feature here https://github.com/jrichardsz/http-operator or a basic shell script to detect incoming request to a specific port like How to print incoming http request on specific port
GCP is offering several serverless products (like you mentioned) and they offer a pricing where you are only charged for the resources you use (when requests are processed).
In Cloud Run you are only billed when an instance is handling a
request using the autoscaling to know more. See their pricing as well for a better overview.
For Google App Engine the app.yaml configuration file contains several settings you can use to adjust the trade-off between performance and resource load for a specific version of your app. You
also check this link how to manage the auto scaling settings.
You can also check this Google Cloud blog for other strategies in auto scaling your applications.
To answer the Comment below:
This video can help you better understand their differences to be able to see the appropriate service for your use case.
To clarify, there's 2 variations of cloud run, the first is managed by google and the other runs on gke. As long as your classic application (api app) is stateless, you should be able to deploy it as a container and take advantage of being charged based on only the resources you use. Snippets would fall under Cloud function where it only runs functions based on triggers.
You can choose to deploy your Cloud Run app on fully managed infrastructure ("serverless", pay per use, auto-scaling up rapidly and down to 0 depending on traffic) or on a Google Kubernetes Engine cluster.
It is also possible to run Docker containers in Serverless using App Engine (Flexible). App Engine is always fully managed, with auto-scaling. App Engine Flex auto-scales gradually and down to 1. App Engine Second Generation auto-scales up rapidly and down to 0.
In your current use case I would recommend to use Cloud Run, check its limitations first before getting started. See the official documentation here and on Cloud Run How-To Guides

Difference between app and Dyno on Heroku?

I don't understand what the difference between an app and Dyno is.
I want to use the hobby plan so that I can use an own SSL domain and that the servers stops sleeping.
I have a backend (nodeJS) and a frontend (reactJS).
Heroku says $7/Dyno. Does that mean I have to pay $7 for one app? Or do I pay $7 and can use several apps with it, so that they don't sleep?
An App is a set of one or more different dynos. This latter can be either of the same or different type (e.g. web, workers, ...) and having a different tier (e.g. standard, hobby, performance ...). You can see here the details for your better understanding.
It is possible to execute more instances of the same dyno type (e.g. for high-availability, processing concurrency ...). You can see here and here for details.
You basically pay for the number of dynos you run.

Is it possible to run two applications on one hobby dyno?

I have $161 platform credits on heroku from GitHub student pack to spend for one hobby dyno:
The Heroku offer is for one (1) free Hobby Dyno for two years, which will be applied on your invoice as a discount of $7 for a Hobby Dyno.
I already deployed one spring app and changed its dyno to hobby. My question is if there is a way I could deploy second Java app and set it to use the same dyno which is assigned for the first app?
Right now I have one app which has hobby dyno and one app which uses free dyno. I read on the internet and people say that there is only one app allowed for one dyno and Heroku will charge me for the second one but there is also this thread How many apps are allowed on a 'Hobby' Heroku plan? which says that I can have more than one app per hobby dyno.
So what's the truth?
No, you can't run multiple apps on a single dyno.
Heroku's model is to run one app per dyno (and often many dynos for a single app). The question you reference discussed the Hobby plan¹, asking how many dynos can be run per account. Keep in mind that Heroku's model is different from the shared or VPS hosting you might be used to. Dynos don't provide an OS that you can put apps onto; they run apps directly.
¹Technically I don't think this makes a ton of sense since accounts don't have these kinds of tiers. One account can run free dynos, hobby dynos, and professional dynos. But there is a difference between unverified accounts, which can run up to five free dynos, and verified accounts which can run many more.
According to this article on the heroku page it is possible but not recommended.
Heroku post

Is it possible to upload 2 applications into the same heroku plan?

I am currently paying for a hobby heroku plan and I have already deployed an application, is it possible to have another application (different code and database) running in the same server as mine?
You can run as many Heroku apps as you want in your account. However, you need to configure each app to use either free or paid dynos, add-ons etc. independently.
So if you have a second app with different code and DB, you need to provision it separately with either free or paid plans. It will have its own URL, and will incur its own charges.

Resources