What exactly is a single Heroku Web Dyno? What exactly is a single Heroku Web Dyno? heroku heroku

What exactly is a single Heroku Web Dyno?


When you deploy a Heroku application, you build a virtual machine image called a slug using one or more buildpacks. When a virtual machine instance is launched from this slug, it's called a dyno.

Each dyno runs a single process inside your application virtual machine. Heroku does not officially describe how dynos are provisioned, but anecdotal analysis shows many dynos are run on a single Amazon XL EC2 instance, sharing disk, CPU, and memory across all dynos. There are definitely "noisy neighbors" when sharing resources, but direct data or stats are not provided. I can only share my anecdotal experience that this does indeed happen.

Each dyno is isolated within the EC2 hosting machine, but shares the underlying resources. This is similar to how docker and other application containers work.

Dynos are registered with the Heroku Routing Mesh, an intelligent load balancer that maps incoming web traffic to the application dyno. Each dyno has a TCP port assigned that's registered with the routing mesh.

Heroku is a higher-level service on top of Amazon EC2. They implement deployment, provisioning, monitoring, availability, and auto-scaling at a premium cost to raw EC2 hosting. You can run your own EC2 instances, but need to implement those services yourself.

Disclaimer: I am not a Heroku employee and have no special knowledge of Heroku other than as a user of a large, high traffic Rails app.

UPDATE: Heroku launched PX size dynos this morning, which are hosted on a dedicated EC2 c1.xlarge instance, which solves all of the issues of noisy neighbors and resource contention I alluded to above. At a heft price tag. Details here: https://blog.heroku.com/archives/2014/2/3/heroku-xl