使用SPECCPU2006基准测试

曾经用SEPCCPU2006测试过Xen上面Win8(某beta版本)作为guest的性能,与native系统进行对比,以便衡量Hypervisor的性能(当然也可以作为压力和稳定性测试的工具)。最近,又在做KVM、Xen上面压力测试的自动化脚本,再次用到了SPECCPU2006,所以简单写几点关于SPECCPU2006的介绍、配置和注意事项吧。

1. SPECCPU简介
SPEC CPU2006:
CPU2006 is SPEC's next-generation, industry-standardized, CPU-intensive benchmark suite, stressing a system's processor, memory subsystem and compiler.
主要是CPU的压力比较大;另外,也需要较多的内存;也写了不少的文件,有一定的I/O压力。
http://www.spec.org/cpu2006/

2.某次Xen上面Win8中跑SPECCPU2006的测试记过,且和native的对比。
2.1 环境配置:
hardware:a Romley-EP system
Xen version:Upstream changeset: #25110
Dom0:Linux upstream 3.1-rc7,2 pinned vCPUs,2GB memory
HVM Guest:Win8 Server (win2012),8 pinned vCPUs,16GB memory

2.2 Xen上的speccpu2006测试结果
某次的测试结果为90%左右的CPU性能(当然可能会优化得更高,如95%是可能的);About 91% performance in INT computing, and 88% in FP computing.
INT: integer 整型计算; FP: float point 浮点计算。


3. SPECCPU2006的一些配置经验:

3.1 先运行shrc来准备测试环境的准备,然后执行runspec命令来实际开始基准测试。

3.2 runsepc命令语法为:runspec [options] [list of benchmarks to run]

3.3 如果生成有效的报告,则需要跑int, fp, 或者 all(就包括int、fp);否则,你也可以随意选择一个自己想跑的benchmark。

3.4 --tune参数中base和peak的区别在于:base是简单的标准的配置(一般跑个base就可以衡量性能了),peak是可以提供更多个性化的配置编译选项。 默认值就是"--tune base". (--tune 也简写为 -T,如"-T base"、 --tune all (包括base和peak))。
The base metrics (e.g. SPECint_base2006) are required for all reported results and have stricter guidelines for compilation. For example, the same flags must be used in the same order for all benchmarks of a given language. This is the point closer to those who might prefer a relatively simple build process.
The peak metrics (e.g. SPECint2006) are optional and have less strict requirements. For example, different compiler options may be used on each benchmark, and feedback-directed optimization is allowed. This point is closer to those who may be willing to invest more time and effort in development of build procedures.

3.5 配置文件中(文件名中),rate和speed的区别:rate是系统的能达到的总体能力的衡量;speed是系统完成一个任务的速度的衡量。我一般选择rate来看看一段时间内,系统到底能处理多少任务。默认值就是使用rate这种度量方式。
There are several different ways to measure computer performance. One way is to measure how fast the computer completes a single task; this is a speed measure. Another way is to measure how many tasks a computer can accomplish in a certain amount of time; this is called a throughput, capacity or rate measure.

3.6 action参数是定义做什么测试动作,一般完整的是“--action=validate”,当然你也可以只做编译build、运行run、搭建环境setup等这样的步骤。

3.7 选择copy数量,一般来说copy数量等于CPU核的个数,参数为“-C num”(或--copies num)。注意:如果选择speed度量方式,其copy就是1,是不可以更改的。 其实“-r 4”就等于"--rate --copies 4".

3.8 "-c file"等于"--config file",用于指定本次运行的配置文件。

3.9 "-o formate"等于“--output_format format”,指定生成输出报告、文件的格式。

3.10 我常选择的配置文件如下:
Linux: Example-linux64-amd64-gcc43.cfg
Windows: cpu2006.1.1.ic12.winx64.sse42.rate.cfg
an example command line: bin/runspec --action=validate -o all -r 4 -c Example-linux64-amd64-gcc43.cfg all

其实,SPECCPU提供了很详细的参考文档,如下:
常见问题的解答:www.spec.org/cpu2006/Docs/readme1st.html
runspec命令参数:http://www.spec.org/cpu2006/Docs/runspec.html

master

Stay hungry, stay foolish.

发表评论

邮箱地址不会被公开。 必填项已用*标注

*