1.phoronix Test Suite介绍

phoronix Test Suite是综合的测试和benchmark平台,可以在Linux, Solaris, OS X, 和 BSD操作系统上进行benchmark测试。默认自带60多个测试套件和200多个独立的测试profile。每个profile都可以在phoronix-test-suite中单独进行测试。测试套件则由一组测试profile组成。一个profile由Bash/shell脚本和xml文件组成。此外提供了测试对比([http://www.openbenchmarking.org/][1]),不过这个需要能够连上外网。phoronix-test-suite官网链接如下:[http://www.phoronix-test-suite.com/][2] 

2.使用

2.1 预置条件工具解压即可使用,但是需要如下预置:       需要安装php5(通过yum源安装即可,yum install php)       需要PHP都DOM扩展,文档对象模型(Document Object Model,DOM)是一种用于HTML和XML文档的编程            接口。它给文档提供了一种结构化的表示方法,可以改变文档的内容和呈现方式。#yum install php-xml,会需要一个依赖包(libxslt),yum会自动匹配并安装。2.2 安装执行安装目录中的install.sh脚本#./install-sh 

Phoronix Test Suite Installation Completed
Executable File: /usr/bin/phoronix-test-suite
Documentation: /usr/share/doc/phoronix-test-suite/
Phoronix Test Suite Files: /usr/share/phoronix-test-suite/

2.3 测试使用基本使用语法如下:

phoronix-test-suite [options]
phoronix-test-suite benchmark [test | suite]
常用的还有
phoronix-test-suite install 
phoronix-test-suite run

    2.3.1   benchmark

以phoronix-test-suite benchmark为例:
#phoronix-test-suite benchmark smallpt
这条命令表示下载、安装、执行并报告一个简单的CPU测试smallpt。
这个benchmark命令把整套测试工作(下载、安装、执行并报告)给执行完毕了。
输出如下:
Phoronix Test Suite v7.2.1
To Install: pts/smallpt-1.0.2
Determining File Requirements ..........................................
Searching Download Caches ..............................................
1 Test To Install
1 File To Download [0.01MB]
1MB Of Disk Space Is Needed
pts/smallpt-1.0.2:
Test Installation 1 of 1
1 File Needed [0.01 MB]
Downloading: smallpt-1.tar.gz [0.01MB]
Downloading ........................................................
Installation Size: 0.1 MB
Installing Test @ 23:27:18
System Information
.......
.....
.......
Would you like to save these test results (Y/n):

/*该测试命令先下载安装smalltp测试套件,并识别系统信息。    最后一条显示是否保存测试结果,选择Y,提示输入一个保存文件的结果名字和描述附后,如下段文字显示,完毕后开始启        动测试:*/Enter a name to save these results under: ptstestnmaeEnter a unique name to describe this test run / configuration: smalltp

If desired, enter a new description below to better describe this result set / system configuration under test.
Press ENTER to proceed without changes.
Current Description: 2 x Intel Xeon xxxx via the Phoronix Test Suite.
New Description: no description
Smallpt 1.0:
pts/smallpt-1.0.2
Test 1 of 1
Estimated Trial Run Count: 3
Estimated Time To Completion: 4 Minutes [23:33 CDT]
Started Run 1 @ 23:29:57
Started Run 2 @ 23:30:31
Started Run 3 @ 23:31:04
Global Illumination Renderer; 100 Samples:
32
32
32
Average: 32 Seconds
Deviation: 0.00%
Do you want to view the text results of the testing (Y/n): ptstestnmae
no description
smalltp:
…….

/可以选择是否上传到官网,这样可以和其他测试人员数据进行对比/

Would you like to upload the results to OpenBenchmarking.org (Y/n):     Would you like to attach the system logs (lspci, dmesg, lsusb, etc) to the test result (Y/n): 

Results Uploaded To: http://openbenchmarking.org/result/[testid]

ps:本地的测试结果保存在 ./var/lib/phoronix-test-suite/test-results/ptstestnmae文件夹中。是否上传在测试结束时候可以进行人工选择。如果上传了,可以通过登陆

http://openbenchmarking.org/result/[testid]
本次测试结果中显示了CPU、主板、内存、硬盘、操作系统、显卡、网络、文件系统、编译器等系统信息。

    2.3.2   install & run如果不使用benchmark,可以通过install & run来实现测试。phoronix-test-suite install 会安装测试套件,但并不会去测试。可以安装哪些测试套件,通过通过phoronix-test-suite list-tests查看。如果要测试apache benchmark,可以先进行安装如下:#phoronix-test-suite install apache安装完毕后,继续测试,执行run命令如下:#phoronix-test-suite run apache性能值是每秒的请求数量(Requests Per Second),越大越好。    2.3.3   同一机型下WEB服务器对比上结中既然测试了apache benchmark, 那么再增加一个nginx的对比结果。命令使用benchmark,这样会自动安装并测试:

#phoronix-test-suite benchmark nginx
作者使用环境中测试得到测试结果,发现同样环境下nginx(16690.36)比apache(15567.89)的静态响应要稍微快一点的。

    2.3.4   批量运行还有一个问题需要解决,例如想在晚上一直运行,将所有测试项进行一轮测试,然后在第二天白天拿到结果分析。这就需要批量运行。批量运行前需要先进行批量设置如下(批量运行apache,nginx):    #phoronix-test-suite batch-setup apache nginx然后可以进行批量运行:    #phoronix-test-suite batch-benchmark apache nginx运行会串行进行,最后得到的结果和单独运行时一样的。

3.小结

从Phoronix Test Suite使用来看,操作虽有些复杂,但是功能还是很强大。特别其是支持的测试套件非常之多,覆盖较全。可以用来对比不同机型下的性能对比,也可以用来对比不用应用(例如apache/nginx)在用一个机器上的性能差异。