UnixBench是一個類unix系(Unix,BSD,Linux)統下的性能測試工具,一個開源工具,被廣泛用與測試linux系統主機的性能。Unixbench的主要測試項目有:系統調用、讀寫、進程、圖形化測試、2D、3D、管道、運算、C庫等系統基准性能提供測試數據。
安裝
wget https://s3.amazonaws.com/cloudbench/software/UnixBench5.1.3.tgz --no-check-certificate
tar xf UnixBench5.1.3.tgz
cd UnixBench
make -j8
使用
./Run # 等待10~60分鍾,出結果
結果示例
"""
make all
make[1]: Entering directory '/home/dewan/work/UnixBench'
Checking distribution of files
./pgms exists
./src exists
./testdir exists
./tmp exists
./results exists
make[1]: Leaving directory '/home/dewan/work/UnixBench'
sh: 1: 3dinfo: not found
# # # # # # # ##### ###### # # #### # #
# # ## # # # # # # # ## # # # # #
# # # # # # ## ##### ##### # # # # ######
# # # # # # ## # # # # # # # # #
# # # ## # # # # # # # ## # # # #
#### # # # # # ##### ###### # # #### # #
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
8 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10
8 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10
8 x Execl Throughput 1 2 3
8 x File Copy 1024 bufsize 2000 maxblocks 1 2 3
8 x File Copy 256 bufsize 500 maxblocks 1 2 3
8 x File Copy 4096 bufsize 8000 maxblocks 1 2 3
8 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10
8 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10
8 x Process Creation 1 2 3
8 x System Call Overhead 1 2 3 4 5 6 7 8 9 10
8 x Shell Scripts (1 concurrent) 1 2 3
8 x Shell Scripts (8 concurrent) 1 2 3
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: LAPTOP-NFVVPB14: GNU/Linux
OS: GNU/Linux -- 5.10.16.3-microsoft-standard-WSL2 -- #1 SMP Fri Apr 2 22:23:49 UTC 2021
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (4192.0 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
CPU 1: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (4192.0 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
CPU 2: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (4192.0 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
CPU 3: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (4192.0 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
CPU 4: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (4192.0 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
CPU 5: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (4192.0 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
CPU 6: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (4192.0 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
CPU 7: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (4192.0 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
21:13:36 up 6:08, 0 users, load average: 0.17, 0.05, 0.01; runlevel unknown
------------------------------------------------------------------------
Benchmark Run: Mon Dec 13 2021 21:13:36 - 21:41:36
8 CPUs in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 31271617.9 lps (10.0 s, 7 samples)
Double-Precision Whetstone 6893.8 MWIPS (9.9 s, 7 samples)
Execl Throughput 5103.8 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 1250688.8 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 353369.6 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 2797005.3 KBps (30.0 s, 2 samples)
Pipe Throughput 2190662.0 lps (10.0 s, 7 samples)
Pipe-based Context Switching 16276.4 lps (10.0 s, 7 samples)
Process Creation 6255.0 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 9968.6 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 3964.2 lpm (60.0 s, 2 samples)
System Call Overhead 2897227.0 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 31271617.9 2679.7
Double-Precision Whetstone 55.0 6893.8 1253.4
Execl Throughput 43.0 5103.8 1186.9
File Copy 1024 bufsize 2000 maxblocks 3960.0 1250688.8 3158.3
File Copy 256 bufsize 500 maxblocks 1655.0 353369.6 2135.2
File Copy 4096 bufsize 8000 maxblocks 5800.0 2797005.3 4822.4
Pipe Throughput 12440.0 2190662.0 1761.0
Pipe-based Context Switching 4000.0 16276.4 40.7
Process Creation 126.0 6255.0 496.4
Shell Scripts (1 concurrent) 42.4 9968.6 2351.1
Shell Scripts (8 concurrent) 6.0 3964.2 6607.0
System Call Overhead 15000.0 2897227.0 1931.5
========
System Benchmarks Index Score 1508.1
------------------------------------------------------------------------
Benchmark Run: Mon Dec 13 2021 21:41:36 - 10:50:25
8 CPUs in system; running 8 parallel copies of tests
Dhrystone 2 using register variables 184612035.4 lps (10.0 s, 7 samples)
Double-Precision Whetstone 43384.1 MWIPS (10.1 s, 7 samples)
Execl Throughput 18266.1 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 796475.7 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 229964.4 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1808295.6 KBps (30.0 s, 2 samples)
Pipe Throughput 10878971.6 lps (10.0 s, 7 samples)
Pipe-based Context Switching 1491847.1 lps (10.0 s, 7 samples)
Process Creation 28912.2 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 36066.7 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 5083.6 lpm (60.0 s, 2 samples)
System Call Overhead 12490140.8 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 184612035.4 15819.4
Double-Precision Whetstone 55.0 43384.1 7888.0
Execl Throughput 43.0 18266.1 4247.9
File Copy 1024 bufsize 2000 maxblocks 3960.0 796475.7 2011.3
File Copy 256 bufsize 500 maxblocks 1655.0 229964.4 1389.5
File Copy 4096 bufsize 8000 maxblocks 5800.0 1808295.6 3117.8
Pipe Throughput 12440.0 10878971.6 8745.2
Pipe-based Context Switching 4000.0 1491847.1 3729.6
Process Creation 126.0 28912.2 2294.6
Shell Scripts (1 concurrent) 42.4 36066.7 8506.3
Shell Scripts (8 concurrent) 6.0 5083.6 8472.6
System Call Overhead 15000.0 12490140.8 8326.8
========
System Benchmarks Index Score 4932.6
"""
測試項說明
### Dhrystone 2 using register variables
此項用於測試 string handling,因為沒有浮點操作,所以深受軟件和硬件設計(hardware and software design)、編譯和鏈接(compiler and linker options)、代碼優化(code optimazaton)、對內存的cache(cache memory)、等待狀態(wait states)、整數數據類型(integer data types)的影響。
### Double-Precision Whetstone
這一項測試浮點數操作的速度和效率。這一測試包括幾個模塊,每個模塊都包括一組用於科學計算的操作。覆蓋面很廣的一系列 c 函數:sin,cos,sqrt,exp,log 被用於整數和浮點數的數學運算、數組訪問、條件分支(conditional branch)和程序調用。此測試同時測試了整數和浮點數算術運算。
### Execl Throughput
此測試考察每秒鍾可以執行的 execl 系統調用的次數。execl 系統調用是 exec 函數族的一員。它和其他一些與之相似的命令一樣是 execve() 函數的前端。
### File copy
測試從一個文件向另外一個文件傳輸數據的速率。每次測試使用不同大小的緩沖區。這一針對文件 read、write、copy 操作的測試統計規定時間(默認是 10s)內的文件 read、write、copy 操作次數。
### Pipe Throughput
管道(pipe)是進程間交流的最簡單方式,這里的 Pipe throughtput 指的是一秒鍾內一個進程可以向一個管道寫 512 字節數據然后再讀回的次數。需要注意的是,pipe throughtput 在實際編程中沒有對應的真實存在。
### Pipe-based Context Switching
這個測試兩個進程(每秒鍾)通過一個管道交換一個不斷增長的整數的次數。這一點很向現實編程中的一些應用,這個測試程序首先創建一個子進程,再和這個子進程進行雙向的管道傳輸。
### Process Creation
測試每秒鍾一個進程可以創建子進程然后收回子進程的次數(子進程一定立即退出)。process creation 的關注點是新進程進程控制塊(process control block)的創建和內存分配,即一針見血地關注內存帶寬。一般說來,這個測試被用於對操作系統進程創建這一系統調用的不同實現的比較。
### System Call Overhead
測試進入和離開操作系統內核的代價,即一次系統調用的代價。它利用一個反復地調用 getpid 函數的小程序達到此目的。
### Shell Scripts
測試一秒鍾內一個進程可以並發地開始一個 shell 腳本的 n 個拷貝的次數,n 一般取值 1,2,4,8。(我在測試時取 1, 8)。這個腳本對一個數據文件進行一系列的變形操作(transformation)。