Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Heroku Dynos and Dyno Managers
1. Dyno and Dyno Managers
Micheal Iyanda
IT Director, Python Nigeria
North East CPA Trailblazer Nigeria
National Secretary General NACOSS
Facebook, gitlab, github, instagram --- miyanda2
Twitter - @miyanda000
micheal.iyanda@trailblazercgl.com
2. Dynos are isolated, virtualized Linux containers that are designed to execute code based on a
user-specified command.
Dynos: the heart of the Heroku platform
3. Learn about how dynos work on Heroku
Buildtime: preparing code
to run in a dyno The dyno lifecycle
Dynos in Heroku Private
Spaces
Runtime: configuring
process and dyno types Scaling apps with dynos
5. Buildtime
Preparing code to run in a dyno
Heroku needs only three things from the developer: source code, a list of dependencies, and
a “Procfile” (a text file that indicates which command should be used to start the code
running).
6. The dyno lifecycle
With Heroku, developers don’t need to worry about dyno or container operations while
their app is running. Dynos are automatically managed by the platform. A dyno is
composed of an isolated virtualized runtime environment and file system. Dynos are
ephemeral by design. They are cycled (restarted) at least once a day to help maintain the
health of your app and overall system, and they permit graceful exit to process remaining
requests. For apps running multiple dynos, each will be cycled at different intervals.
7. Dynos in Heroku Private Spaces
Private Spaces enable developers to build and run Heroku apps that meet strict
requirements for data protection and change control. Apps running in a Private Space
can only run Private Dynos.
8. Runtime
Configuring process and dyno types
When you deploy or scale your app, Heroku will automatically create one or more dynos,
each loaded with the same stack and slug representing your application. Heroku's Dyno
Manager then executes the command you provided in your configuration file to start your
application running on Heroku. Heroku enables developers to fine-tune their app’s
runtime resources by choosing from a broad range of dyno types and dyno
configurations to create a “dyno formation.”
Dyno configurations
Process types
9. Scaling apps with dynos
Heroku provides easy-to-use tools that enable developers to instantly scale dynos to
meet demand. Post deployment, your apps may require adjustments to their dyno
formation in response to a variety of conditions, such as increased traffic, uneven usage
patterns, new functionality, or business scale. You can scale using the Heroku
Dashboard or Heroku CLI.
Heroku Dashboard
Heroku CLI
Scaling horizontally: adding more dynos
Scaling vertically: upgrading to larger dynos
Autoscaling
The build system takes the application, its dependencies, and the language runtime and produces a “slug.” A slug contains everything needed to run the app, except for the operating system.
Dyno configurations
Most modern applications are composed of interacting pieces. For example, a typical web application may have a web component that is responsible for handling web traffic. It may also have a queue (on Heroku typically represented by an add-on), and one or more workers that are responsible for taking elements off of the queue and processing them. Heroku lets you create this kind of architecture by allowing you to configure your dyno formation with dynos of a specific “process type.”
Process types
Heroku apps use a single configuration file, the "Procfile," to specify the process types needed to run the app. Each process type represents a command that should be executed by the Dyno Manager when starting a dyno. There are three primary process types:
Web dynos: receive HTTP traffic from routers and typically run web servers.
Worker dynos: execute anything else, such as background jobs, queuing systems, and timed jobs.
One-off dynos: are temporary and not part of an ongoing dyno formation. They run short-lived commands, possibly attached to a local terminal, and are typically used to handle administrative tasks such as running a REPL shell to execute database migrations or occasional background work.