UnixBenchで仮想サーバのベンチマークを行なう

Updated:

Linux/Unixの性能を比較するのに、UnixBenchというベンチマークテストがよく使われます。このエントリは、Ubuntuで、UnixBenchを実行する手順のメモです。

UnixBenchを実行するには、makeとgccが必要です。それぞれ同名のパッケージをインストールします。

$ sudo apt-get install make gcc

UnixBenchのソースファイルをダウンロード、展開します。2014/5/11時点では、最新版はバージョン5.1.3です。

$ wget https://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
$ tar xvzf UnixBench5.1.3.tgz

ソースはUnixBenchというディレクトリに展開されるので、そこにcdして、ベンチマークを実行します。実行には結構時間がかかります。

$ cd UnixBench/
$ ./Run

実行結果は標準出力に表示されます。次の例は、さくらVPS 2G(3 CPU、メモリ: 2GByte、HDD)の実行結果です。

スコアは2344.6(150行目)。マルチCPUの場合には、1CPUのスコア858.7も表示されます(117行目)。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
UnixBench実行結果

さくらVPS 2G

1CPU   858.7
3CPU  2344.6

----------------------------------------------------------------------
   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com


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

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

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

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

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

1 x Process Creation  1 2 3

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

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

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

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

3 x Execl Throughput  1 2 3

3 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

3 x File Copy 256 bufsize 500 maxblocks  1 2 3

3 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

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

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

3 x Process Creation  1 2 3

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

3 x Shell Scripts (1 concurrent)  1 2 3

3 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: crewe: GNU/Linux
   OS: GNU/Linux -- 3.2.0-24-generic -- #39-Ubuntu SMP Mon May 21 16:52:17 UTC 2012
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Westmere E56xx/L56xx/X56xx (Nehalem-C) (4800.2 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET
   CPU 1: Westmere E56xx/L56xx/X56xx (Nehalem-C) (4800.2 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET
   CPU 2: Westmere E56xx/L56xx/X56xx (Nehalem-C) (4800.2 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET
   11:01:51 up 28 days, 23:04,  2 users,  load average: 0.39, 0.17, 0.11; runlevel 2

------------------------------------------------------------------------
Benchmark Run: Sun May 11 2014 11:01:51 - 11:29:58
3 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       23048603.3 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2922.5 MWIPS (10.0 s, 7 samples)
Execl Throughput                               1750.2 lps   (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        711947.7 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          204926.8 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1440846.8 KBps  (30.0 s, 2 samples)
Pipe Throughput                             1707528.4 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  12367.7 lps   (10.0 s, 7 samples)
Process Creation                               3317.0 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   5002.2 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1527.1 lpm   (60.0 s, 2 samples)
System Call Overhead                        3041492.1 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   23048603.3   1975.0
Double-Precision Whetstone                       55.0       2922.5    531.4
Execl Throughput                                 43.0       1750.2    407.0
File Copy 1024 bufsize 2000 maxblocks          3960.0     711947.7   1797.8
File Copy 256 bufsize 500 maxblocks            1655.0     204926.8   1238.2
File Copy 4096 bufsize 8000 maxblocks          5800.0    1440846.8   2484.2
Pipe Throughput                               12440.0    1707528.4   1372.6
Pipe-based Context Switching                   4000.0      12367.7     30.9
Process Creation                                126.0       3317.0    263.3
Shell Scripts (1 concurrent)                     42.4       5002.2   1179.8
Shell Scripts (8 concurrent)                      6.0       1527.1   2545.1
System Call Overhead                          15000.0    3041492.1   2027.7
                                                                   ========
System Benchmarks Index Score                                         858.7

------------------------------------------------------------------------
Benchmark Run: Sun May 11 2014 11:29:58 - 11:58:14
3 CPUs in system; running 3 parallel copies of tests

Dhrystone 2 using register variables       61617995.0 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     8639.3 MWIPS (9.7 s, 7 samples)
Execl Throughput                               7591.2 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        751724.9 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          203754.0 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1624047.6 KBps  (30.0 s, 2 samples)
Pipe Throughput                             4786270.2 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 554642.7 lps   (10.0 s, 7 samples)
Process Creation                              20066.9 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                  11306.3 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1731.6 lpm   (60.1 s, 2 samples)
System Call Overhead                        6606973.4 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   61617995.0   5280.0
Double-Precision Whetstone                       55.0       8639.3   1570.8
Execl Throughput                                 43.0       7591.2   1765.4
File Copy 1024 bufsize 2000 maxblocks          3960.0     751724.9   1898.3
File Copy 256 bufsize 500 maxblocks            1655.0     203754.0   1231.1
File Copy 4096 bufsize 8000 maxblocks          5800.0    1624047.6   2800.1
Pipe Throughput                               12440.0    4786270.2   3847.5
Pipe-based Context Switching                   4000.0     554642.7   1386.6
Process Creation                                126.0      20066.9   1592.6
Shell Scripts (1 concurrent)                     42.4      11306.3   2666.6
Shell Scripts (8 concurrent)                      6.0       1731.6   2886.0
System Call Overhead                          15000.0    6606973.4   4404.6
                                                                   ========
System Benchmarks Index Score                                        2344.6