36

According to Why do people use Heroku when AWS is present? What distinguishes Heroku from AWS?, it seems that several Heroku Web Dynos run on a single Amazon EC2 CPU.

How many Dynos run on one CPU? What are the specs?

Do a large number of Dynos running on one CPU affect the other Dynos?

Community
  • 1
  • 1
B Seven
  • 44,484
  • 66
  • 240
  • 385
  • They are kinda fuzzy about them... – Rico Jan 30 '14 at 17:34
  • It's worth to say that Heroku routing mesh is not so intelligent, it distributes requests RANDOMLY across your dynos. In cases where there are a large number of dynos, the algorithm MAY optionally bias its selection towards dynos resident in the same AWS availability zone as the router making the selection. – Pere Joan Martorell Oct 26 '19 at 20:40

1 Answers1

64

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

Winfield
  • 18,985
  • 3
  • 52
  • 65
  • 2
    Well its a "dedicated" ec2 instance which itself is shared so there is still the issue of noisy neighbors. Before it was more of a noisy roommate with noisy neighbors :) – Blankman May 12 '14 at 16:26
  • Some dynos are on a shared underlying EC2 instance, some (PX class) dynos are on dedicated EC2 instances. – Winfield May 12 '14 at 18:55
  • 1
    Agreed, but what I mean is the 'dedicated' ec2 instance is on a shared server, it isn't a dedicated server with a single instance on it so the concept of a 'noisy neighbor' is still present. – Blankman May 12 '14 at 19:33
  • 1
    Yes, virtual machines all the way down. – Winfield May 12 '14 at 21:58
  • 1
    What do you mean by virtual machine image? What is a buildpack? – Jwan622 Apr 19 '16 at 14:19