Phoronix Test Suite支持搭建

一直以来,Linux系统下都缺少一个标准且针对整体的测试工具,用户若想测试CPU或显卡性能的话,不得不自行进行相关测试,如运行lame进行MP3编码测试CPU性能、运行DOOM来测试显卡性能。更不方便的是,由于不同的用户使用了不同版本不同架构的测试工具,所得的结果可比性大打折扣。Phoronix测试套件能够很好的解决上述问题,本文旨在帮助大家快速部署和使用Phoronix Test Suite 及Phoromatic web服务端。

搭建环境:deepin/debian/ubuntu
软件版本:Phoronix Test Suite 7.8 (Stable)

1.下载安装:
首先从官网下载Phoronix Test Suite 7.8 (Stable),下载地址:phoronix-test-suite.com/?k=downloads,直接下载ubuntu/debian对应版本即可。

    sudo dpkg -i phoronix-test-suite_7.8.0_all.deb

可以直接安装phoronix-test-suite,这个软件包支持多架构,龙芯,神威上面都可以直接安装。

2.Phoromatic:
Phoromatic是Phoronix测试套件的远程管理和测试编排系统。Phoromatic允许自动调度测试,远程安装新测试,并通过一个直观,易于使用的Web界面管理多个测试系统。测试可以安排在多个测试系统上自动运行。测试结果可以从这个集中的基于网络的位置获得。最新一代Phoromatic服务器和客户端内置于Phoronix Test Suite 5.4代码库和更新版本中。Phoromatic也已经成为一个Phoromatic.com托管的实例,具有防火墙和授权选项,以及在Phoronix测试套件中集成一个全功能的内置服务器实例作为开源软件。Phoromatic允许跨系统调度基准,可以定时进行(具有不同的日期和时间选项),手动基准或外部触发基准 – 允许无限制的可能性,如挂钩和触发新的测试无论何时发生新的Git提交或满足其他外部条件。最简单的形式,可以通过phoronix-test-suite start-phoromatic-server命令或通过启用phoromatic-serversystemd服务来部署Phoromatic Server 。从启动的Web界面获取创建帐户所需的所有信息,并开始将Phoronix Test Suite客户端连接到此Phoromatic服务器。
上面这段是从Phoromatic官网翻译得来,按照官网说明,我们使用:

phoronix-test-suite start-phoromatic-server 

启动服务。

终端打印输出如下:

zs@zs-PC:~$ phoronix-test-suite start-phoromatic-server 
Port 8382 chosen as random port for this instance. Change the default port via the Phoronix Test Suite user configuration file.
PHP SQLite3 support must first be enabled before accessing the Phoromatic server (e.g. installing the php5-sqlite or php-pdo package depending on the distribution).

第一段表示服务端口号为随机8382,第二段表示需要安装php5-sqlite。我们先来修改随机端口号:

    vi /home/zs/.phoronix-test-suite/user-config.xml
      RemoteAccessPort RANDOM RemoteAccessPort
      WebSocketPort RANDOM WebSocketPort

修改这两个随机port,我这里remoteaccessport 设置为 9527,websocketport设置为9528。
安装php5-sqlite:

    sudo apt-get install php5-sqlite

完成上述操作后重新启动:

zs@zs-PC:~$ phoronix-test-suite start-phoromatic-server 
Phoronix Test Suite v7.8.0 (Folldal) starting Phoromatic Server
Phoronix Test Suite User-Data Directory Path: /home/zs/.phoronix-test-suite/
Phoronix Test Suite Configuration File: /home/zs/.phoronix-test-suite/user-config.xml
Phoromatic Server Log File: /home/zs/.phoronix-test-suite/phoromatic.log

Launching with PHP built-in web server.

WebSocket Server Active: localhost:9528
The Phoromatic Web Interface Is Accessible At: http://localhost:9527
Press [ENTER] to kill server...

可以看到上述设置生效,这样我们就可以通过http://localhost:9527 访问本地phoronix web服务了。

3.Phoromatic 使用:
注册phoromatic后,登录可以看到管理界面。首先我们可以看到一段使用介绍:

Phoromatic
To get started with your new account, the basic steps to get started include:
Connect/sync the Phoronix Test Suite client systems (the systems to be benchmarked) to this account. In the simplest form, you just need to run the following command on the test systems: phoronix-test-suite     phoromatic.connect 10.0.13.201:9527/VH1CMJ. For more information view the instructions on the systems page.
Configure your account settings.
Create a test schedule. A schedule is for running test(s) on selected system(s) on a routine, timed basis or whenever a custom trigger is passed to the Phoromatic server. A test schedule could be for running benchmarks on a      daily basis, whenever a new Git commit is applied to a code-base, or other events occurred. You can also enrich the potential by adding pre/post-test hooks for ensuring the system is set to a proper state for benchmarking.     Alternatively, you can create a benchmark ticket for one-time testing on one or more systems.
View the automatically generated test results.
If you are interested in Phoromatic and the Phoronix Test Suite for enterprise testing, please contact us for commercial support, custom test development, custom engineering services, and other professional services. It's not without corporate support and sponsorship that we can continue to develop this leading open-source Linux benchmarking software. If you run into any problems with our open-source software or would like to contribute patches, you can do so via our GitHub project.

我们在客户端使用:

 phoronix-test-suite phoromatic.connect 10.0.13.201:9527/VH1CMJ

就可以链接到phoromatic web服务端了。接下来是创建测试计划,和开始测试,你会发现客户端测试计划无法被触发。其实客户端默认是需要被授权才能访问的。所以我们可以在管理界面勾选下面选项。

Enabling this option will make new test systems immediately available for this account rather than the default behavior of first needing an administrator to approve/deny the system via the Phoromatic Server web interface. With this option enabled, the systems are automatically approved by default but can be later disabled/removed via the Phoromatic web interface. 

这样我们客户端测试机状态可以看到从未授权改为等待任务状态。接下来我们就可以为所欲为的进行自动化测试计划编排和测试了。

3 条思考于 “Phoronix Test Suite支持搭建

  1. zhaofangfang

    下次每次版本更新PTS测试就交给你执行了啊,对比每个版本的性能数据差别,测试报告里给你预留坑位。。

发表评论

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