测试步骤
CPU和内存性能测试
测试环境
操作系统: CentOS 7 云平台版本: >= v3.7.7 宿主机: Dell PowerEdge R730xd
- CPU: Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz
- 内存: DDR4 2133 MHz 256GB (16GB x 16)
- 磁盘: 机械盘 20TB PERC H730P Mini (RAID 10)
- 网卡: 10000Mb/s
安装测试软件
测试工具:
- UnixBench: 测试虚拟机CPU性能
- mbw: 测试内存性能
# 安装 UnixBench
$ yum install -y git gcc autoconf gcc-c++ time perl-Time-HiRes
$ git clone https://github.com/kdlucas/byte-unixbench.git
# 安装 mbw
$ git clone https://github.com/raas/mbw.git && cd mbw
$ make && ./mbw 512
CPU 测试
测试命令:
$ cd byte-unixbench/UnixBench
$ ./Run -c 1 whetstone-double dhry2reg fsdisk
结论:
| 指标 | 物理机 | 虚拟机 | 虚拟化开销(物理机-虚拟机/ 物理机) |
|---|---|---|---|
| Dhrystone | 34839728.4 lps | 33964545.0 lps | 2.5% |
| Double-Precision Whetstone | 4368.3 MWIPS | 4244.3 MWIPS | 2.8% |
| File Copy | 1825548.4 KBps | 1788048.3 KBps | 2.1% |
内存测试
结论:
| 指标 | 物理机 | 虚拟机 | 虚拟化开销(物理机-虚拟机/物理机) |
|---|---|---|---|
| MEMCPY AVG | 7578.348 MiB/s | 6254.520 MiB/s | 1.7% |
本地存储IO测试
测试方法
采用fio,分别用如下场景和命令测试:
- 4KB随机读
fio --name=random-read --ioengine=posixaio --rw=randread --bs=4k --size=4g --numjobs=1 --iodepth=16 --runtime=60 --time_based --direct=1
- 4KB随机写
fio --name=random-write --ioengine=posixaio --rw=randwrite --bs=4k --size=4g --numjobs=1 --iodepth=16 --runtime=60 --time_based --direct=1 --end_fsync=1
- 4K顺序读
fio --name=random-read --ioengine=posixaio --rw=read --bs=4k --size=4g --numjobs=1 --iodepth=16 --runtime=60 --time_based --direct=1
- 4K顺序写
fio --name=random-write --ioengine=posixaio --rw=write --bs=4k --size=4g --numjobs=1 --iodepth=16 --runtime=60 --time_based --direct=1 --end_fsync=1
- 1MB顺序读
fio --name=seq-read --ioengine=posixaio --rw=read --bs=1m --size=16g --numjobs=1 --iodepth=1 --runtime=60 --time_based --direct=1
- 1MB顺序写
fio --name=seq-write --ioengine=posixaio --rw=write --bs=1m --size=16g --numjobs=1 --iodepth=1 --runtime=60 --time_based --direct=1 --end_fsync=1
测试环境
-
物理机
OS: CentOS Linux release 7.9.2009 (Core) 内核:3.10.0-1062.4.3.el7.yn20191203.x86_64 CPU: Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz 内存:256G RAID控制器:Broadcom / LSI MegaRAID SAS-3 3108 RAID Level: RAID10
-
Linxu 虚拟机
OS: CentOS Linux release 7.6.1810 (Core) 内核:3.10.0-957.12.1.el7.x86_64 配置:4核CPU4G内存30G系统盘100G数据盘
-
Windows 虚拟机
OS: Windows Server 2008 R2 Datacenter 6.1 配置:4核CPU4G内存40G系统盘100G数据盘