Linux跑分-unixbench性能測試
我們在選擇和評論一款VPS的性能時候,從理論上我們會從配置信息、硬件對比,以及帶寬速度,包括這里老蔣要分享的UnixBench跑分測試。尤其是跑分測試數據基本上可以反映出這款VPS的整體性能數據,但是也不能作為唯一參考。比如之前我在Linode VPS上面測試的跑分數據在500-700之間,但是有些OPENVZ VPS跑分在2000-3000,UnixBench跑分僅僅是作為參考,一般在400分以上都差不多。
// 安裝運行環境
yum install -y make gcc g++
// 下載
wget https://github.com/aliyun/byte-unixbench/releases/download/v5.1.6/UnixBench-5.1.6.tar.gz
// 解壓
tar -zxvf UnixBench-5.1.6.tar.gz
// 運行,從releases下載的是已經編譯好了的
cd /UnixBench-5.1.6/UnixBench
./Run
數據解讀
# 測試聚焦在字符串處理,沒有浮點運算操作。這個測試用於測試鏈接器編譯、代碼優化、內存緩存、等待狀態、整數數據類型等,硬件和軟件設計都會非常大的影響測試結果。
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
# 此測試考察每秒鍾可以執行的 execl 系統調用的次數
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
# 一秒鍾內一個進程可以向一個管道寫 512 字節數據然后再讀回的次數
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
# 測試一秒鍾內一個進程可以並發地開始一個shell 腳本的 n 個拷貝的次數,n 一般取值1,2,4,8.
1 x Shell Scripts (1 concurrent) 1 2 3
1 x Shell Scripts (8 concurrent) 1 2 3
2 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10
2 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10
2 x Execl Throughput 1 2 3
2 x File Copy 1024 bufsize 2000 maxblocks 1 2 3
2 x File Copy 256 bufsize 500 maxblocks 1 2 3
2 x File Copy 4096 bufsize 8000 maxblocks 1 2 3
2 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10
2 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10
2 x Process Creation 1 2 3
2 x System Call Overhead 1 2 3 4 5 6 7 8 9 10
2 x Shell Scripts (1 concurrent) 1 2 3
2 x Shell Scripts (8 concurrent) 1 2 3
========================================================================
############ 系統的基本信息 ####################
BYTE UNIX Benchmarks (Version 5.1.6)
System: VM-16-12-centos: GNU/Linux
OS: GNU/Linux -- 3.10.0-1160.31.1.el7.x86_64 -- #1 SMP Thu Jun 10 13:32:12 UTC 2021
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) Gold 6133 CPU @ 2.50GHz (4988.3 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
CPU 1: Intel(R) Xeon(R) Gold 6133 CPU @ 2.50GHz (4988.3 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
17:18:21 up 44 min, 2 users, load average: 0.16, 0.09, 0.11; runlevel 2021-11-03
------------------------------------------------------------------------
########### 單核心跑分情況
Benchmark Run: Wed Nov 03 2021 17:18:21 - 17:46:24
2 CPUs in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 30242862.5 lps (10.0 s, 7 samples)
Double-Precision Whetstone 4057.4 MWIPS (9.2 s, 7 samples)
Execl Throughput 2143.2 lps (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 404486.7 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 114360.9 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1217538.3 KBps (30.0 s, 2 samples)
Pipe Throughput 597871.6 lps (10.0 s, 7 samples)
Pipe-based Context Switching 41061.2 lps (10.0 s, 7 samples)
Process Creation 7089.6 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 4693.1 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 927.7 lpm (60.0 s, 2 samples)
System Call Overhead 382315.4 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 30242862.5 2591.5
Double-Precision Whetstone 55.0 4057.4 737.7
Execl Throughput 43.0 2143.2 498.4
File Copy 1024 bufsize 2000 maxblocks 3960.0 404486.7 1021.4
File Copy 256 bufsize 500 maxblocks 1655.0 114360.9 691.0
File Copy 4096 bufsize 8000 maxblocks 5800.0 1217538.3 2099.2
Pipe Throughput 12440.0 597871.6 480.6
Pipe-based Context Switching 4000.0 41061.2 102.7
Process Creation 126.0 7089.6 562.7
Shell Scripts (1 concurrent) 42.4 4693.1 1106.9
Shell Scripts (8 concurrent) 6.0 927.7 1546.1
System Call Overhead 15000.0 382315.4 254.9
========
System Benchmarks Index Score 712.4
------------------------------------------------------------------------
########### 整體跑分情況
Benchmark Run: Wed Nov 03 2021 17:46:24 - 18:14:36
2 CPUs in system; running 2 parallel copies of tests
Dhrystone 2 using register variables 59846268.9 lps (10.0 s, 7 samples)
Double-Precision Whetstone 7782.5 MWIPS (9.9 s, 7 samples)
Execl Throughput 3964.4 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 618072.5 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 161525.5 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1934016.5 KBps (30.0 s, 2 samples)
Pipe Throughput 1133058.0 lps (10.0 s, 7 samples)
Pipe-based Context Switching 138129.7 lps (10.0 s, 7 samples)
Process Creation 12641.4 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 6468.6 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 976.9 lpm (60.1 s, 2 samples)
System Call Overhead 701379.4 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 59846268.9 5128.2
Double-Precision Whetstone 55.0 7782.5 1415.0
Execl Throughput 43.0 3964.4 922.0
File Copy 1024 bufsize 2000 maxblocks 3960.0 618072.5 1560.8
File Copy 256 bufsize 500 maxblocks 1655.0 161525.5 976.0
File Copy 4096 bufsize 8000 maxblocks 5800.0 1934016.5 3334.5
Pipe Throughput 12440.0 1133058.0 910.8
Pipe-based Context Switching 4000.0 138129.7 345.3
Process Creation 126.0 12641.4 1003.3
Shell Scripts (1 concurrent) 42.4 6468.6 1525.6
Shell Scripts (8 concurrent) 6.0 976.9 1628.2
System Call Overhead 15000.0 701379.4 467.6
========
System Benchmarks Index Score 1233.9
公有雲數據對比
各公有雲1核1G的雲主機跑分對比,數據來自常見公有雲機器的unixbench跑分對比