How many CPU cores has a heroku dyno?

2020-06-07 06:20发布

I'm using Django with Celery 3.0.17 and now trying to figure out how many celery workers are run by default.

From this link I understand that (not having modified this config) the number of workers must be currently equal to the number of CPU cores. And that's why I need the former. I wasn't able to find an official answer by googling or searching heroku's dev center. I think it's 4 cores as I'm seeing 4 concurrent connections to my AMQP server, but I wanted to confirm that.

Thanks,

J

2条回答
Luminary・发光体
2楼-- · 2020-06-07 07:06

According to https://blog.heroku.com/archives/2014/2/3/heroku-xl

|       | 1X Dyno      | Performance Dyno  |
|-------|--------------|-------------------|
| RAM   | 512 MB       | 6 GB              |
|       | 1x - 4x      | 40x (8 CPU cores) |
| Price | $0.05 / hour | $0.80 / hour      |

The 2X dynos also have 4 cores:

$ heroku run --size=2X grep -c processor /proc/cpuinfo --app app-name
Running grep -c processor /proc/cpuinfo on app-name... up, run.3685
4

But the PX dynos have 8 cores:

$ heroku run --size=PX grep -c processor /proc/cpuinfo --app app-name
Running grep -c processor /proc/cpuinfo on app-name... up, run.4731
8
查看更多
在下西门庆
3楼-- · 2020-06-07 07:10

The number of CPUs is not published and is subject to change, but you can find out at runtime by running grep -c processor /proc/cpuinfo.

查看更多
登录 后发表回答