回忆之城
生命在于折腾
posts - 575,comments - 9,trackbacks - 0
Unixbench 的 google code 主页:
http://code.google.com/p/byte-unixbench/

以下文字中文部分多从以上网页的英文英文原文翻译过来,余下尚有一些补充:

unixbench 是一个用于测试 unix 系统性能的工具,也是一个比较通用的 benchmark
,起于 1983 年,很多人都用它的测试结果作为自己试验时系统的客观描述。unixbench 执行一些列的测试。然后为了直观了解,将每一个测试的结果和一个基准值进行比较已得到一个 index 值,所有项的 index 值在一起形成系统的测试值。更多信息请移步上面的网页哈~~这里不多贴 E 文也不提供过多翻译~~

测试前工作:
首先下载,需要版本为: unixbench-4.1.0。

> tar -xzfv unixbench-x.x.xx
> cd unixbench-x.x.xx
> vim README        // 这一步是标准地入门途径哈,一般要么 README,要么INSTALL
> make

make 时因为 gcc 版本太高,导致编译时出现一问题:无效的 -fforce-mem 选项,这在前一篇文章已说明。解决方法为直接在解压后的目录文件夹里修改 Makefile 文件,找到 -fforce-mem 选项并有效删除之。切记要看清,不要删除的只是注释文档哈~~我差点就这个杯具~~

> ./Run

/* *******************************************************************
   然后屏幕上慢慢出现以下字样:(最开始的的几秒钟可能什么都没出现,   *
   那可能是因为你的机器配置太低或者当时负载太重,要在淡定中等待~~   *
   注:翻译中除明确指出是频率或者时间标准的时候,其余标准应该是每秒   *
   钟(ps),这从测试结果中也可看出。                                                *
*********************************************************************/

make all
make[1]: Entering directory `/home/shepherd/Software_package/unixbench-4.1.0'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[1]: Leaving directory `/home/shepherd/Software_package/unixbench-4.1.0'

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

                 4        1           Based on the Byte Magazine Unix Benchmark
                44       11
   v   v       4 4        1
    v v       44444       1           v4.1 revisions mostly by David C. Niemi,
     v           4   o   111          Reston, VA, USA  <niemi@tux.org>


Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10 //数字意思是进行了几组,一个个地出现

System Call Overhead  1 2 3 4 5 6 7 8 9 10

Pipe Throughput  1 2 3 4 5 6 7 8 9 10

Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

Process Creation  1 2 3

Execl Throughput  1 2 3

Filesystem Throughput 1024 bufsize 2000 maxblocks  1 2 3

Filesystem Throughput 256 bufsize 500 maxblocks  1 2 3

Filesystem Throughput 4096 bufsize 8000 maxblocks  1 2 3

Shell Scripts (1 concurrent)  1 2 3
Shell Scripts (8 concurrent)  1 2 3
Shell Scripts (16 concurrent)  1 2 3

Arithmetic Test (type = short)  1 2 3

Arithmetic Test (type = int)  1 2 3

Arithmetic Test (type = long)  1 2 3

Arithmetic Test (type = float)  1 2 3

Arithmetic Test (type = double)  1 2 3

Arithoh  1 2 3

C Compiler Throughput  1 2 3

Dc: sqrt(2) to 99 decimal places  1 2 3

Recursion Test--Tower of Hanoi  1 2 3

join: file 2 is not in sorted order
join: file 1 is not in sorted order

-------------------------------- 插播时间,对以上各输出的解释, start  ---------------------------------

Double-precision Whetstone


1. ***********************
Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

此项产生于 1984,测试 string handling,因为没有浮点操作,所以深受软件和硬件设计(hardware and software design)、编译和链接(compiler and linker options)、代码优化(code optimazaton)、对内存的cache(cache memory)、等待状态(?wait states)、整数数据类型(integer data types)的影响

2. ********************
Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

这一项测试浮点数操作的速度和效率。这一测试包括几个模块,每个模块都包括一组用于科学计算的操作。覆盖面很广的一系列 c 函数:sin,cos,sqrt,exp,log 被用于整数和浮点数的数学运算、数组访问、条件分支(conditional branch)和程序调用。此测试同时测试了整数和浮点数算术运算。

3. **************
System Call Overhead  1 2 3 4 5 6 7 8 9 10
测试进入和离开操作系统内核的代价,即一次系统调用的代价。它利用一个反复地调用 getpid 函数的小程序达到此目的。

4. ***************
Pipe Throughput  1 2 3 4 5 6 7 8 9 10
管道(pipe)是进程间交流的最简单方式,这里的 Pipe throughtput 指的是一秒钟内一个进程可以向一个管道写 512 字节数据然后再读回的次数。需要注意的是,pipe throughtput 在实际编程中没有对应的真实存在。

5. *************
Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10
这个测试两个进程(每秒钟)通过一个管道交换一个不断增长的整数的次数。这一点很向现实编程中的一些应用,这个测试程序首先创建一个子进程,再和这个子进程进行双向的管道传输。

6. ************
Process Creation  1 2 3
测试每秒钟一个进程可以创建子进程然后收回子进程的次数(子进程一定立即退出)。process creation 的关注点是新进程进程控制块(process control block)的创建和内存分配,即一针见血地关注内存带宽。一般说来,这个测试被用于对操作系统进程创建这一系统调用的不同实现的比较。

7. ***********
Execl Throughput  1 2 3
此测试考察每秒钟可以执行的 execl 系统调用的次数。 execl 系统调用是 exec 函数族的一员。它和其他一些与之相似的命令一样是 execve() 函数的前端。

8. *********** 
File copy
测试从一个文件向另外一个文件传输数据的速率。每次测试使用不同大小的缓冲区。这一针对文件 read、write、copy 操作的测试统计规定时间(默认是 10s)内的文件 read、write、copy 操作次数。
 
Filesystem Throughput 1024 bufsize 2000 maxblocks  1 2 3

Filesystem Throughput 256 bufsize 500 maxblocks  1 2 3

Filesystem Throughput 4096 bufsize 8000 maxblocks  1 2 3

9. **********
Shell Scripts
测试一秒钟内一个进程可以并发地开始一个 shell 脚本的 n 个拷贝的次数,n 一般取值 1,2,4,8.(我的系统上取 1, 8, 16)。这个脚本对一个数据文件进行一系列的变形操作(?transformation)。

Shell Scripts (1 concurrent)  1 2 3
Shell Scripts (8 concurrent)  1 2 3
Shell Scripts (16 concurrent)  1 2 3

10. *********
Arithmetic Test

Arithmetic Test (type = short)  1 2 3

Arithmetic Test (type = int)  1 2 3

Arithmetic Test (type = long)  1 2 3

Arithmetic Test (type = float)  1 2 3

Arithmetic Test (type = double)  1 2 3

11. *************
Arithoh  1 2 3

注:这个不知道是什么,也不去翻译了,就叫 Arithoh 测试 得了~~或请高手指点

12. *************
C Compiler Throughput  1 2 3

13. *************
Dc: sqrt(2) to 99 decimal places  1 2 3
sqrt(2) 到 99 位小数。

14. *************
Recursion Test--Tower of Hanoi  1 2 3

15. *************
join: file 2 is not in sorted order
join: file 1 is not in sorted order

注:猜测这个应该测试的有稳定性测试,就是测试排序前后是否会改变相对位置~~纯属猜测~

注:后几项在google code 网页上没有出现,估计是版本的差异,但是应该能够看出来了。
------------------------------------------ 插播时间, end ---------------------------------------------------

然后是运行结果(中途去吃饭了,没有注意具体时间,以下为屏幕原本输出):

==============================================================

  BYTE UNIX Benchmarks (Version 4.1.0)
  System -- Linux zimo 2.6.31-18-generic #55-Ubuntu SMP Fri Jan 8 14:55:26 UTC 2010 i686 GNU/Linux
  Start Benchmark Run: Tue Feb  2 15:45:51 CST 2010
   4 interactive users.
   15:45:51 up  6:04,  4 users,  load average: 0.29, 0.20, 0.13
  lrwxrwxrwx 1 root root 4 2009-11-02 23:44 /bin/sh -> dash
  /bin/sh: symbolic link to `dash'
  /dev/sda8             59424160  25136084  31269468  45% /
Dhrystone 2 using register variables     13070738.1 lps   (10.0 secs, 10 samples)
Double-Precision Whetstone                 2299.0 MWIPS (10.0 secs, 10 samples)
System Call Overhead                     821168.0 lps   (10.0 secs, 10 samples)
Pipe Throughput                          656560.3 lps   (10.0 secs, 10 samples)
Pipe-based Context Switching             189230.7 lps   (10.0 secs, 10 samples)
Process Creation                           7178.8 lps   (30.0 secs, 3 samples)
Execl Throughput                           2564.0 lps   (29.5 secs, 3 samples)
File Read 1024 bufsize 2000 maxblocks    1201655.0 KBps  (30.0 secs, 3 samples)
File Write 1024 bufsize 2000 maxblocks   604752.0 KBps  (30.0 secs, 3 samples)
File Copy 1024 bufsize 2000 maxblocks    358077.0 KBps  (30.0 secs, 3 samples)
File Read 256 bufsize 500 maxblocks      333029.0 KBps  (30.0 secs, 3 samples)
File Write 256 bufsize 500 maxblocks     160968.0 KBps  (30.0 secs, 3 samples)
File Copy 256 bufsize 500 maxblocks      104803.0 KBps  (30.0 secs, 3 samples)
File Read 4096 bufsize 8000 maxblocks    2323874.0 KBps  (30.0 secs, 3 samples)
File Write 4096 bufsize 8000 maxblocks   1225018.0 KBps  (30.0 secs, 3 samples)
File Copy 4096 bufsize 8000 maxblocks    803435.0 KBps  (30.0 secs, 3 samples)
Shell Scripts (1 concurrent)               2597.2 lpm   (60.0 secs, 3 samples)
Shell Scripts (8 concurrent)                743.8 lpm   (60.0 secs, 3 samples)
Shell Scripts (16 concurrent)               395.1 lpm   (60.0 secs, 3 samples)
Arithmetic Test (type = short)           2356900.2 lps   (10.0 secs, 3 samples)
Arithmetic Test (type = int)             2386769.5 lps   (10.0 secs, 3 samples)
Arithmetic Test (type = long)            2380829.4 lps   (10.0 secs, 3 samples)
Arithmetic Test (type = float)           1123845.4 lps   (10.0 secs, 3 samples)
Arithmetic Test (type = double)          1117699.0 lps   (10.0 secs, 3 samples)
Arithoh                                       1.0 lps   (0.0 secs, 3 samples)
C Compiler Throughput                      1108.9 lpm   (60.0 secs, 3 samples)
Dc: sqrt(2) to 99 decimal places          84485.7 lpm   (30.0 secs, 3 samples)
Recursion Test--Tower of Hanoi           108186.2 lps   (20.0 secs, 3 samples)


                     INDEX VALUES            
TEST                                        BASELINE     RESULT      INDEX

Dhrystone 2 using register variables        116700.0 13070738.1     1120.0
Double-Precision Whetstone                      55.0     2299.0      418.0
Execl Throughput                                43.0     2564.0      596.3
File Copy 1024 bufsize 2000 maxblocks         3960.0   358077.0      904.2
File Copy 256 bufsize 500 maxblocks           1655.0   104803.0      633.3
File Copy 4096 bufsize 8000 maxblocks         5800.0   803435.0     1385.2
Pipe Throughput                              12440.0   656560.3      527.8
Process Creation                               126.0     7178.8      569.7
Shell Scripts (8 concurrent)                     6.0      743.8     1239.7
System Call Overhead                         15000.0   821168.0      547.4
                                                                 =========
     FINAL SCORE                                                     733.7

Known benchmarks are: 
 dhry2reg whetstone-double syscall pipe context1 spawn execl fstime fsbuffer fsdisk shell short int long float double arithoh C dc hanoi


----------------------------- 屏幕输出到此为止 #

大致就是以上这些,关于 unix/linux 系统的 bench 还有其他的一些,没有去用,但是这里给个链接,做储备拉~~ 是 sourceforge 上的一系列工具的索引网页,很好的总结:叫做  “Linux Benchmark Suite Homepage” :
http://lbs.sourceforge.net/
posted on 2014-04-07 20:34 回忆之城 阅读(142) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。