Unix Bench 是一个基于 Unix/Linux 系统的独立主机 (Dedicated Host) 和虚拟独立主机 (VPS) 的性能测试软件。目前此开源软件已经搬迁到了 Google Codes,具体介绍、源码下载和版本信息,可访问 Google Codes: byte-unixbench。下面是引用的简要英文说明:
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 很简单。通过 SSH 登录到你的 Dedicated Host 或 VPS 之后,依次执行下列命令:
wget http://licess.googlecode.com/files/unixbench-4.1.0-wht.tar.gz tar xzf unixbench-4.1.0-wht.tar.gz cd unixbench-4.1.0-wht-2/ make ./Run
需要注意的是:有些主机商提供的独立主机和 VPS,默认是最小安装,没有安装 gcc 等开发编译工具。如果 make 的过程中出错,提示没有 gcc 模块,则需要先装上 gcc。例如以 CentOS 为例,可直接通过执行 yum -y install gcc 安装。
执行 ./Run 之后,等上大约 15 分钟左右的时候,就可以看到测试结果了。
我分别用它测试了一下家里的开发用虚拟机,Theplanet 独机,以及 Linode 的 VPS,测试结果如下:
https://www.xiaohui.com/dev/unix-bench-vps-dedicated-host-test.htm
物理机器:Windows 7 x64;四核 2.4G CPU,1 TB SATA 硬盘,8 GB 内存
虚拟机器:CentOS 5.3;内存 360MB, 硬盘 8GB。
在此虚拟机(VPS) 上测得的分值如下:
TEST BASELINE RESULT INDEX Dhrystone 2 using register variables 376783.7 5904043.5 156.7 Double-Precision Whetstone 83.1 1266.3 152.4 Execl Throughput 188.3 1541.2 81.8 File Copy 1024 bufsize 2000 maxblocks 2672.0 66945.0 250.5 File Copy 256 bufsize 500 maxblocks 1077.0 18655.0 173.2 File Read 4096 bufsize 8000 maxblocks 15382.0 487062.0 316.6 Pipe-based Context Switching 15448.6 43080.0 27.9 Pipe Throughput 111814.6 386201.9 34.5 Process Creation 569.3 3305.2 58.1 Shell Scripts (8 concurrent) 44.8 328.7 73.4 System Call Overhead 114433.5 257605.8 22.5 ========= FINAL SCORE 88.1
这是一台用了四五年的 Theplanet 老独机。物理机器配置:Cent OS 4.x, 单核 P4 2.8G , 80 GB IDE 硬盘,512 MB 内存
在此独立主机上测得的分值如下:
TEST BASELINE RESULT INDEX Dhrystone 2 using register variables 376783.7 2766766.2 73.4 Double-Precision Whetstone 83.1 640.1 77.0 Execl Throughput 188.3 2849.4 151.3 File Copy 1024 bufsize 2000 maxblocks 2672.0 51862.0 194.1 File Copy 256 bufsize 500 maxblocks 1077.0 17975.0 166.9 File Read 4096 bufsize 8000 maxblocks 15382.0 278327.0 180.9 Pipe-based Context Switching 15448.6 162037.2 104.9 Pipe Throughput 111814.6 648600.6 58.0 Process Creation 569.3 10289.5 180.7 Shell Scripts (8 concurrent) 44.8 353.7 79.0 System Call Overhead 114433.5 524731.3 45.9 ========= FINAL SCORE 106.5
在这之前,我一直以为,无论如何,我自己家里的开发机,就算是 VPS,也应该比 Theplanet 的老独机性能要强。但结果竟然还差了近 20 分,真是杯具了。
昨天买了一台 Linode (我的 ref code 是 0bdefa22908e02aae2d46e4fc563f9c06c961806) 最低档的 VPS - Linode 360,虚拟机的配置是 CentOS 5.3, 内存 360 MB, 硬盘 16 GB。物理机器的配置:8核 CPU 2.5G (dual Xeon L5420 CPUs, quad-core, 2.5 GHz), two 1 TB Harddis in RAID 1。
在此 Linode VPS 上测得的分值如下:
TEST BASELINE RESULT INDEX Dhrystone 2 using register variables 376783.7 22685142.0 602.1 Double-Precision Whetstone 83.1 1417.9 170.6 Execl Throughput 188.3 6257.1 332.3 File Copy 1024 bufsize 2000 maxblocks 2672.0 172032.0 643.8 File Copy 256 bufsize 500 maxblocks 1077.0 39244.0 364.4 File Read 4096 bufsize 8000 maxblocks 15382.0 1218712.0 792.3 Pipe-based Context Switching 15448.6 433027.6 280.3 Pipe Throughput 111814.6 2590619.7 231.7 Process Creation 569.3 12107.8 212.7 Shell Scripts (8 concurrent) 44.8 1599.5 357.0 System Call Overhead 114433.5 1977568.7 172.8 ========= FINAL SCORE 332.0
Linode 最低档的 VPS 分值竟然也有 332,是 Theplanet 老独机的 3 倍。
你的主机 Unix Bench 测试分值是多少?欢迎在评论中贴出来。
Quote:
TEST BASELINE RESULT INDEX
Dhrystone 2 using register variables 376783.7 4615788.4 122.5
Double-Precision Whetstone 83.1 1455.3 175.1
Execl Throughput 188.3 1305.0 69.3
File Copy 1024 bufsize 2000 maxblocks 2672.0 60022.0 224.6
File Copy 256 bufsize 500 maxblocks 1077.0 17081.0 158.6
File Read 4096 bufsize 8000 maxblocks 15382.0 506329.0 329.2
Pipe Throughput 111814.6 357753.0 32.0
Pipe-based Context Switching 15448.6 65702.4 42.5
Process Creation 569.3 2539.6 44.6
Shell Scripts (8 concurrent) 44.8 394.7 88.1
System Call Overhead 114433.5 347641.5 30.4
=========
FINAL SCORE 89.2