1

我在 IBM x3550 M4 服务器上的 Ubuntu 15.10 x64 上的 Xen 4.5.1 内的 PV 虚拟机上运行 CPU 基准测试工具 (LINPACK)。此工具应消耗所有可能的可用 CPU 周期。我通过在 Xen PV (test.cfg) 中定义它来分配 4 个 vCPU。但是,LINPACK 仅检测到 1 个内核和 4 个线程,而它应该检测到至少 4 个内核:

CPU frequency:    2.494 GHz
Number of CPUs: 1
Number of cores: 1
Number of threads: 4

这是 lscpu 在 Xen PV VM 中所说的:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    4
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Model name:            Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz
Stepping:              4
CPU MHz:               2500.062
BogoMIPS:              5000.12
Hypervisor vendor:     Xen
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              10240K
NUMA node0 CPU(s):     0-3

其他平台,如 Docker 和 HVM,确实会在虚拟节点内分配内核(见下文)。这些节点的性能明显优于 Xen PV 虚拟节点。

CPU frequency:    2.499 GHz
Number of CPUs: 2
Number of cores: 8
Number of threads: 4

这是 DomU Xen 主机 lscpu:

lscpu

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             2
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Model name:            Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz
Stepping:              4
CPU MHz:               2500.062
BogoMIPS:              5000.12
Hypervisor vendor:     Xen
Virtualization type:   none
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              10240K
NUMA node0 CPU(s):     0-7

Xen vCPU 列表:

xl vcpu-list

Domain-0                             0     0    7   -b-      10.1  all / all
Domain-0                             0     1    2   -b-       6.5  all / all
Domain-0                             0     2    4   r--       2.6  all / all
Domain-0                             0     3    0   r--       3.9  all / all
Domain-0                             0     4    3   -b-       4.4  all / all
Domain-0                             0     5    6   -b-       2.6  all / all
Domain-0                             0     6    5   -b-       4.7  all / all
Domain-0                             0     7    7   -b-       2.9  all / all
test                                 3     0    1   -b-       1.5  0-3 / all
test                                 3     1    0   -b-       1.8  0-3 / all
test                                 3     2    0   -b-       0.7  0-3 / all
test                                 3     3    2   -b-       0.6  0-3 / all

xen DomU PV VM 配置:

cat test.cfg

bootloader = '/usr/lib/xen-4.5/bin/pygrub'

vcpus   =  '4'
memory  =  '2048'
cpus    = "0-3"

是否有任何选项可以为半虚拟化来宾提供主机 CPU 拓扑?换句话说,我如何让 Xen 使用更多的 vCPU 内核/vCPU?

谢谢!

4

0 回答 0