AWS EC2:实例上可用的 cpu 个内核数

AWS EC2: The number of cpu cores available on an instance

我最近设置了一个实例 (m4.4xlarge)。

当我执行“lscpu”命令时,输出如下所示:

CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-15
Thread(s) per core:    2
Core(s) per socket:    8
CPU socket(s):         1
      .
      .
      .

这是否意味着只能使用 8 个内核?

如果是这样,其余的 CPU 有什么用?

m4.4xlarge 实例有 16 个 logical CPUs,所以看起来你的 EC2 实例报告它只有一个套接字,有 1 个物理套接字CPU 有 8 个核心。每个核心可以同时执行两个线程(英特尔超线程技术),因此每个核心呈现为 2 个逻辑 CPUs.

CPU(s):                16 <- logical CPUs (Threads per core * Cores per socket)
On-line CPU(s) list:   0-15
Thread(s) per core:    2  <- Each core has hyperthreading and presents
                             itself as two logical CPUs
Core(s) per socket:    8  <- Instance sees it has 8-core physical CPU per socket
CPU socket(s):         1  <- Instance sees it has 1 physical CPU