How does Heroku billing dynos work exactly?

后端 未结 1 387
清酒与你
清酒与你 2021-02-08 09:28

I was trying to understand the Heroku pricing system. Okay so the free account receives 1000 dyno/hour. What\'s the exact meaning of a dyno/hour? It depends on what? Requests p

1条回答
  •  生来不讨喜
    2021-02-08 09:37

    Assuming you verify your account with a credit card, you have 1000 free dyno hours per month to play with.

    A "dyno hour" is simply one hour of a dyno running.

    If you have just 1 app running just 1 dyno, that dyno could be available 24/7 forever, since even a 31 day month consists of 31 x 24 = 744 hours, which is less than the 1000 free dyno hours you have at your disposal.

    However, if your one dyno on your one app is a "web dyno" (i.e. a web server), then note that free web dynos sleep after 30 minutes of inactivity (in which case the next request to the web dyno "wakes it up").

    Free web-dyno sleeping is a two-edged sword. On the one hand, when a web dyno sleeps, it does not consume any of your free dyno-hours (so you might be able to get more for your 1000 free dyno hours, depending on your needs). If you can tolerate slow response to your web clients in response to any queries that happen to wake up a sleeping dyno - that can be OK. If not, you will need to make sure to keep your web dyno busy (i.e. make sure it does not go 30 minutes without receiving any requests).

    For further details see Free Dyno Hours.

    Note that a dyno is basically just a virtual machine. It is your "server". One dyno can certainly support many many users, depending on the complexity / performance requirements of your app. You can "scale" your app both "vertically" (meaning increased computing capabilities per dyno) and "horizontally" (meaning running multiple dyno instances that load balance your app's traffic). See What is a Heroku "Dyno"?. Your app would need to be processing absolutely GIGANTIC amounts of traffic to justify scaling a dyno to 1000 instances. If you really need to scale your dynos (highly unlikely if you're only just starting to build your app), you will need to use paid dynos.

    0 讨论(0)
提交回复
热议问题