xen dom0
Please refer to Setting Up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12 for the platform of this test (this test runs on Fedora 11, however).
请参阅在Fedora上设置Xen Dom0:在Fedora 12上使用Linux Kernel 2.6.29的Xen 3.4.1,以了解该测试的平台(该测试在Fedora 11上运行)。
I have done some simple performance test on DomU and Dom0 and compare with the performance on physical machines. These test are simple, but it can provides some performance factor of xen. I test the CPU bound, memory write and memory read performance of Dom0, DomU and compare them with the result of the test on physical machine. Each test are done for 50 times and the the Average (E), Standard deviation (SD) and SD/E are calculated.
我已经在DomU和Dom0上进行了一些简单的性能测试,并与物理机上的性能进行了比较。 这些测试很简单,但是可以提供xen的一些性能因素。 我测试了Dom0,DomU的CPU绑定, 内存写入和内存读取性能,并将它们与物理机上的测试结果进行了比较。 每次测试进行50次,然后计算平均值(E),标准偏差(SD)和SD / E。
Test method:
测试方法:
I only past the C code here because I think it is clear enough.
我只在这里跳过了C代码,因为我认为它很清楚。
1) CPU bound:
The code:
1)CPU绑定:
代码:
const int test_limit = 100000;
cout << "-----------------------------" << endl;
cout << "cpu bound test begins." << endl;
clock_t begin_time = clock();
register int a = 0;
for (register int i = 0; i < test_limit; i++) {
for (register int j = 0; j < test_limit; j++) {
a += i + j;
}
}
clock_t end_time = clock();
do_nothing(a);
int time = (end_time - begin_time) / (CLOCKS_PER_SEC / 1000);
2) Memory read:
2)内存读取:
The code:
代码:
const int test_times = 1000000;
const int data_size = 1000000000;
const int data_interval = 1000000;
int* array_read = new int[data_size];
cout << "----------------------" << endl
<< "Memory read bound test begins." << endl;
register int read_value = 0;
long read_begin =0;
long read_end = 0;
int data_range = data_size - test_times;
read_begin = clock();
for (register int t = 0; t < test_times; t++) {
for (register int i = 0; i < data_range; i += data_interval) {
read_value = array_read[i + t];
}
}
read_end = clock();
do_nothing(read_value);
int time = (read_end - read_begin) / (CLOCKS_PER_SEC / 1000);
3) Memory write:
3)内存写入:
The code:
代码:
const int test_times = 1000000;
const int data_size = 1000000000;
const int data_interval = 1000000;
int* array_write = new int[data_size];
cout << "----------------------" << endl
<< "Memory write bound test begins." << endl;
long write_begin = 0;
long write_end = 0;
int data_range = data_size - test_times;
write_begin = clock();
for (register int t = 0; t < test_times; t++) {
for (register int i = 0; i < data_range; i += data_interval) {
array_write[i + t] = 528283;
}
}
write_end = clock();
int time = (write_end - write_begin) / (CLOCKS_PER_SEC / 1000);
The result:
结果:
Performance result on the physical machine:
物理机上的性能结果:
Physical machines test fedora kernel: | |||
cpu | memory read | memory write | |
Average: | 13257.6 | 21449.6 | 22243.8 |
Standard deviation: | 4.72 | 17.2 | 18.96 |
SD/E: | 0 | 0 | 0 |
Perf/Perf on Phy: | 100.00% | 100.00% | 100.00% |
| 物理机测试fedora 内核 : | ||
| 中央处理器 | 内存读取 | 内存写入 |
平均: | 13257.6 | 21449.6 | 22243.8 |
标准偏差: | 4.72 | 17.2 | 18.96 |
SD / E: | 0 | 0 | 0 |
| | | |
Perf / Perf on Phy: | 100.00% | 100.00% | 100.00% |
Performance result on Dom0:
Dom0上的性能结果:
Dom0 suse kernel test | |||
cpu | memory read | memory write | |
Average: | 13283 | 23059 | 23856.6 |
Standard deviation: | 4.58 | 22.38 | 18.07 |
SD/E: | 0 | 0 | 0 |
Perf/Perf on Phy: | 99.81% | 93.02% | 93.24% |
| dom0 suse内核测试 | ||
| 中央处理器 | 内存读取 | 内存写入 |
平均: | 13283 | 23059 | 23856.6 |
标准偏差: | 4.58 | 22.38 | 18.07 |
SD / E: | 0 | 0 | 0 |
| | | |
Perf / Perf on Phy: | 99.81% | 93.02% | 93.24% |
Performance result on DomU:
在DomU上的性能结果:
DomU fedora kernel test | |||
cpu | memory read | memory write | |
Average: | 13307.6 | 23667.8 | 24459.2 |
Standard deviation: | 13.2 | 33.96 | 37.19 |
SD/E: | 0 | 0 | 0 |
Perf/Perf on Phy: | 99.62% | 90.63% | 90.94% |
| DomU fedora内核测试 | ||
| 中央处理器 | 内存读取 | 内存写入 |
平均: | 13307.6 | 23667.8 | 24459.2 |
标准偏差: | 13.2 | 33.96 | 37.19 |
SD / E: | 0 | 0 | 0 |
| | | |
Perf / Perf on Phy: | 99.62% | 90.63% | 90.94% |
From the test, we can see that the CPU performance is nearly 100%. But the memory performance is not so good especially for the DomU. This maybe because of the memory validation of Xen. But the CPU and memory performance of Xen VM is pretty good as a virtual machine.
从测试中我们可以看到CPU性能接近100%。 但是特别是对于DomU,内存性能不是很好。 这可能是由于Xen的内存验证。 但是Xen VM的CPU和内存性能作为虚拟机还是不错的。
翻译自: https://www.systutorials.com/a-simple-cpu-and-memory-performance-test-of-xen-dom0-and-domu/
xen dom0