The heroku puma documentation suggests that you can find this out by running nproc
on a dyno:
So, for example, to see how many are on performance-m, running:
$ heroku run bash --size=performance-l
$ nproc
8
But then dividing by 2, because:
The value returned by nproc includes “hyperthreads” in addition to physical cores, the combination of these two are refered to as the vCPU count. All physical cores used on Heroku have a hyperthread so to gain the “true” number of physical cores divide by two.
Which would mean performance-l
has 4 CPUs.
When I do the same on performance-m
, I get 2, meaning actually only 1 CPU.
Standard-1x and Standard-2x both have nproc
tell me "8", meaning 4 CPUs, but the heroku puma documentation warns that these CPUs are shared with other users since standard dynos are multi-tenant.
The value for nproc from free, hobby, standard-1x, and standard-2x dynos are correct, but these cores are shared between multiple applications running in containers. While nproc for these dynos will all return 8, it is best to assume only one process can execute at a time.
grep -c processor /proc/cpuinfo
in my 1x heroku dynos, the result is4
– Mush