UnixBench is the original BYTE UNIX benchmark suite, updated and revised by many people over the years.
The purpose of UnixBench is to provide a basic indicator of the performance of a Unix-like system; hence, multiple tests are used to test various aspects of the system's performance. These test results are then compared to the scores from a baseline system to produce an index value, which is generally easier to handle than the raw scores. The entire set of index values is then combined to make an overall index for the system.
在 Web Hosting Talk 上,有一个有关 Unix Bench 历时五年的讨论,许多站长将他们的主机分值纷纷贴在上面,目前已长达100多页,有兴趣可以看看:VPS vs. Dedicated - New Benchmark Results (注:从天朝访问此站可能需要翻墙)。
如何使用 Unix Bench
使用 Unix Bench 很简单。通过 SSH 登录到你的 Dedicated Host 或 VPS 之后,依次执行下列命令:
wget http://byte-unixbench.googlecode.com/files/unixbench-5.1.2.tar.gz
tar xzf unixbench-5.1.2.tar.gz
cd unixbench-5.1.2
make
./Run
需要注意的是:有些主机商提供的独立主机和 VPS,默认是最小安装,没有安装 gcc 等开发编译工具。如果 make 的过程中出错,提示没有 gcc 模块,则需要先装上 gcc。例如以 CentOS 为例,可直接通过执行 yum -y install gcc 安装。
执行 ./Run 之后,等上大约 15 分钟左右的时候,就可以看到测试结果了。
Dhrystone 2 using register variables 116700.0 14536409.7 1245.6
Double-Precision Whetstone 55.0 6017.8 1094.1
Execl Throughput 43.0 3110.6 723.4
File Copy 1024 bufsize 2000 maxblocks 3960.0 165773.5 418.6
File Copy 256 bufsize 500 maxblocks 1655.0 43178.4 260.9
File Copy 4096 bufsize 8000 maxblocks 5800.0 514024.6 886.2
Pipe Throughput 12440.0 964690.4 775.5
Pipe-based Context Switching 4000.0 157000.8 392.5
Process Creation 126.0 5662.4 449.4
Shell Scripts (1 concurrent) 42.4 5090.7 1200.6
Shell Scripts (8 concurrent) 6.0 727.3 1212.2
System Call Overhead 15000.0 764257.1 509.5
========
System Benchmarks Index Score 679.4
遨游主机
collect2: ld returned 1 exit status
make: *** [pgms/ubgears] Error 1
wget http://www.CTOHome.com/linux-vps-pack/unixbench.sh;sh ./unixbench.sh