从http://www.phystech.com/?/download/下载ubench.
我们经常需要对不同的服务器进行性能测试,Linux下的性能测试软件其实很多的。ubench是一个使用很简单的测试软件,最新的版本是0.32。但是这个版本在很多机器是无法编译,需要打patch修改一下。这个是一个打好补丁的包 ubench-0.32.zip 。
解压后configure &&make 就会在当前目录下编译出来一个ubench了。
安装部署
./configure
Make; Make install
在2.6.18-128.el5xen #1 SMP Wed Dec 17 12:01:40 EST 2008 x86_64 x86_64 x86_64 ,gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)的HVMdomU机器上编译ubench失败.
cpubench.c: In function 'cpuload':
cpubench.c:93: error: 'CLK_TCK' undeclared (first use in this function)
cpubench.c:93: error: (Each undeclared identifier is reported only once
cpubench.c:93: error: for each function it appears in.)
cpubench.c: In function 'cpubench':
参考
http://www.extmail.org/forum/thread-7882-1-4.html打patch,编译成功.
在运行时,可以用top /vmstat/iostat检查负载情况.当做cpu基准测试时,每一颗cpu usr%高达99%;运行内存基准测试时,system%偏高.
综上可以看到ubench支持多core CPU.
硬件环境
CPU: 8*model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.508
cache size : 6144 KB
内存:MemTotal: 3670016 kB
的HVMdomU
运行结果如下:
[root@rhel53-64-5410-v1 ubench-0.32]# ./ubench
Unix Benchmark Utility v.0.3
Copyright (C) July, 1999 PhysTech, Inc.
Author: Sergei Viznyuk <sv@phystech.com>
http://www.phystech.com/download/ubench.html
Linux2.6.18-128.el5xen #1 SMP Wed Dec 17 12:01:40 EST 2008 x86_64
Ubench CPU: 2575372
Ubench MEM: 496375
--------------------
Ubench AVG: 1535873
在硬件环境如下:
model name :8* Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 10
cpu MHz : 2327.610
cache size : 6144 KB
MemTotal: 4144696 Kb的PowerEdge 1950
运行结果如下:
[liangjz@b2b_plat_1367 ubench-0.32]$ ./ubench
Unix Benchmark Utility v.0.3
Copyright (C) July, 1999 PhysTech, Inc.
Author: Sergei Viznyuk <sv@phystech.com>
http://www.phystech.com/download/ubench.html
Linux2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686
Ubench CPU: 1900088
Ubench MEM: 615346
--------------------
Ubench AVG: 1257717