秋水逸冰大佬的作品,UnixBench是一个类unix系(Unix,BSD,Linux)统下的性能测试工具,一个开源工具,被广泛用与测试Linux系统主机的性能。Unixbench的主要测试项目有:系统调用、读写、进程、图形化测试、2D、3D、管道、运算、C库等系统基准性能提供测试数据。
特点
自动安装UnixBench和测试脚本
系统调用、读写、进程、图形化测试、2D、3D、管道、运算、C库等系统基准性能
使用
wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh
chmod +x unixbench.sh
./unixbench.sh
演示
root@pr2:~# wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh
--2021-03-25 03:44:56-- https://github.com/teddysun/across/raw/master/unixbench.sh
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/teddysun/across/master/unixbench.sh [following]
--2021-03-25 03:44:56-- https://raw.githubusercontent.com/teddysun/across/master/unixbench.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1560 (1.5K) [text/plain]
Saving to: ‘unixbench.sh’
unixbench.sh 100%[================================================================================>] 1.52K --.-KB/s in 0s
2021-03-25 03:44:57 (12.4 MB/s) - ‘unixbench.sh’ saved [1560/1560]
root@pr2:~# chmod +x unixbench.sh
root@pr2:~# ./unixbench.sh
Hit:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
Get:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB]
Get:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:6 http://mirrors.aliyun.com/ubuntu bionic-security/main Sources [248 kB]
Get:7 http://mirrors.aliyun.com/ubuntu bionic-security/restricted Sources [15.7 kB]
Get:8 http://mirrors.aliyun.com/ubuntu bionic-security/universe Sources [277 kB]
Get:9 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 Packages [1,627 kB]
Get:10 http://mirrors.aliyun.com/ubuntu bionic-security/main Translation-en [309 kB]
Get:11 http://mirrors.aliyun.com/ubuntu bionic-security/restricted amd64 Packages [261 kB]
Get:12 http://mirrors.aliyun.com/ubuntu bionic-security/restricted Translation-en [34.1 kB]
Get:13 http://mirrors.aliyun.com/ubuntu bionic-security/universe amd64 Packages [1,116 kB]
Get:14 http://mirrors.aliyun.com/ubuntu bionic-security/universe Translation-en [250 kB]
Get:15 http://mirrors.aliyun.com/ubuntu bionic-updates/restricted Sources [18.5 kB]
Get:16 http://mirrors.aliyun.com/ubuntu bionic-updates/main Sources [506 kB]
Get:17 http://mirrors.aliyun.com/ubuntu bionic-updates/universe Sources [448 kB]
Get:18 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 Packages [1,967 kB]
Get:19 http://mirrors.aliyun.com/ubuntu bionic-updates/main Translation-en [400 kB]
Get:20 http://mirrors.aliyun.com/ubuntu bionic-updates/restricted amd64 Packages [282 kB]
Get:21 http://mirrors.aliyun.com/ubuntu bionic-updates/restricted Translation-en [37.7 kB]
Get:22 http://mirrors.aliyun.com/ubuntu bionic-updates/universe amd64 Packages [1,723 kB]
Get:23 http://mirrors.aliyun.com/ubuntu bionic-updates/universe Translation-en [365 kB]
Get:24 http://mirrors.aliyun.com/ubuntu bionic-proposed/main Sources [92.5 kB]
Get:25 http://mirrors.aliyun.com/ubuntu bionic-proposed/main amd64 Packages [152 kB]
Get:26 http://mirrors.aliyun.com/ubuntu bionic-proposed/main Translation-en [36.3 kB]
Get:27 http://mirrors.aliyun.com/ubuntu bionic-proposed/universe amd64 Packages [26.5 kB]
Get:28 http://mirrors.aliyun.com/ubuntu bionic-proposed/universe Translation-en [12.3 kB]
Fetched 10.7 MB in 4s (2,507 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
autoconf is already the newest version (2.69-11).
automake is already the newest version (1:1.15.1-3ubuntu2).
make is already the newest version (4.1-9.1ubuntu1).
time is already the newest version (1.7-25.1build1).
gcc is already the newest version (4:7.4.0-1ubuntu2.3).
perl is already the newest version (5.26.1-6ubuntu0.5).
perl set to manually installed.
The following packages were automatically installed and are no longer required:
amd64-microcode intel-microcode iucode-tool libdbus-glib-1-2 linux-headers-4.15.0-139 linux-headers-4.15.0-139-generic linux-headers-generic thermald
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 68 not upgraded.
UnixBench5.1.3.tgz not found!!!download now...
--2021-03-25 03:45:16-- https://dl.lamp.sh/files/UnixBench5.1.3.tgz
Resolving dl.lamp.sh (dl.lamp.sh)... 104.21.78.187, 172.67.168.88, 2606:4700:3035::ac43:a858, ...
Connecting to dl.lamp.sh (dl.lamp.sh)|104.21.78.187|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘UnixBench5.1.3.tgz’
UnixBench5.1.3.tgz [ <=> ] 139.90K 270KB/s in 0.5s
2021-03-25 03:45:17 (270 KB/s) - ‘UnixBench5.1.3.tgz’ saved [143259]
UnixBench/
UnixBench/README
UnixBench/src/
UnixBench/src/looper.c
UnixBench/src/time-polling.c
UnixBench/src/arith.c
UnixBench/src/hanoi.c
UnixBench/src/timeit.c
UnixBench/src/dhry_1.c
UnixBench/src/dhry.h
UnixBench/src/dhry_2.c
UnixBench/src/fstime.c
UnixBench/src/syscall.c
UnixBench/src/execl.c
UnixBench/src/context1.c
UnixBench/src/whets.c
UnixBench/src/dummy.c
UnixBench/src/big.c
UnixBench/src/spawn.c
UnixBench/src/pipe.c
UnixBench/src/ubgears.c
UnixBench/pgms/
UnixBench/pgms/index.base
UnixBench/pgms/gfx-x11
UnixBench/pgms/multi.sh
UnixBench/pgms/unixbench.logo
UnixBench/pgms/tst.sh
UnixBench/WRITING_TESTS
UnixBench/.project
UnixBench/Run
UnixBench/testdir/
UnixBench/testdir/sort.src
UnixBench/testdir/cctest.c
UnixBench/testdir/dc.dat
UnixBench/testdir/large.txt
UnixBench/.cproject
UnixBench/results/
UnixBench/Makefile
UnixBench/USAGE
Checking distribution of files
./pgms exists
./src exists
./testdir exists
./results exists
gcc -o ./pgms/arithoh -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Darithoh ./src/arith.c
gcc -o ./pgms/register -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum='register int' ./src/arith.c
gcc -o ./pgms/short -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=short ./src/arith.c
gcc -o ./pgms/int -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=int ./src/arith.c
gcc -o ./pgms/long -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=long ./src/arith.c
gcc -o ./pgms/float -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=float ./src/arith.c
gcc -o ./pgms/double -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=double ./src/arith.c
gcc -o ./pgms/hanoi -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/hanoi.c
gcc -o ./pgms/syscall -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/syscall.c
./src/syscall.c: In function ‘main’:
./src/syscall.c:93:21: warning: null argument where non-null required (argument 2) [-Wnonnull]
execl("/bin/true", (char *) 0);
^~~~~
gcc -o ./pgms/context1 -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/context1.c
gcc -o ./pgms/pipe -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/pipe.c
./src/pipe.c: In function ‘main’:
./src/pipe.c:52:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
pipe(pvec);
^~~~~~~~~~
gcc -o ./pgms/spawn -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/spawn.c
gcc -o ./pgms/execl -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/execl.c
In file included from ./src/execl.c:34:0:
./src/big.c: In function ‘getwork’:
./src/big.c:452:11: warning: variable ‘c’ set but not used [-Wunused-but-set-variable]
char c;
^
./src/big.c: In function ‘fatal’:
./src/big.c:586:5: warning: format not a string literal and no format arguments [-Wformat-security]
fprintf(stderr, s);
^~~~~~~
./src/big.c: In function ‘dummy’:
./src/big.c:112:5: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result [-Wunused-result]
freopen("masterlog.00", "a", stderr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/big.c:200:6: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result [-Wunused-result]
freopen(logname, "w", stderr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/big.c:224:3: warning: ignoring return value of ‘dup’, declared with attribute warn_unused_result [-Wunused-result]
dup(pvec[0]);
^~~~~~~~~~~~
./src/big.c:228:6: warning: ignoring return value of ‘freopen’, declared with attribute warn_unused_result [-Wunused-result]
freopen(logname, "w", stderr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/big.c:321:4: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(fcopy, cp->line, p - cp->line + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/big.c:199:34: warning: ‘%02d’ directive writing between 2 and 10 bytes into a region of size 5 [-Wformat-overflow=]
sprintf(logname, "masterlog.%02d", firstuser/MAXCHILD);
^~~~
./src/big.c:199:23: note: directive argument in the range [-178956970, 178956970]
sprintf(logname, "masterlog.%02d", firstuser/MAXCHILD);
^~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
from ./src/execl.c:25:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 13 and 21 bytes into a destination of size 15
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c
gcc -o ./pgms/dhry2 -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/dhry_1.o ./src/dhry_2.o
cd ./src; rm -f dhry_1.o dhry_2.o
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c -o dhry_1_reg.o
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c -o dhry_2_reg.o
gcc -o ./pgms/dhry2reg -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/dhry_1_reg.o ./src/dhry_2_reg.o
cd ./src; rm -f dhry_1_reg.o dhry_2_reg.o
gcc -o ./pgms/looper -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/looper.c
gcc -o ./pgms/fstime -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/fstime.c
gcc -o ./pgms/whetstone-double -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -DDP -DUNIX -DUNIXBENCH ./src/whets.c -lm
make all
make[1]: Entering directory '/opt/unixbench/UnixBench'
Checking distribution of files
./pgms exists
./src exists
./testdir exists
./tmp exists
./results exists
make[1]: Leaving directory '/opt/unixbench/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
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: pr2.5var.com: GNU/Linux
OS: GNU/Linux -- 4.11.8-041108-generic -- #201706290836 SMP Thu Jun 29 12:38:45 UTC 2017
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz (5200.0 bogomips)
x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
03:45:20 up 2 days, 4:40, 2 users, load average: 0.35, 0.18, 0.10; runlevel 5
------------------------------------------------------------------------
Benchmark Run: Thu Mar 25 2021 03:45:20 - 04:13:29
1 CPU in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 29489596.2 lps (10.0 s, 7 samples)
Double-Precision Whetstone 4058.0 MWIPS (9.9 s, 7 samples)
Execl Throughput 3397.3 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 760398.7 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 232625.7 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1571524.4 KBps (30.0 s, 2 samples)
Pipe Throughput 1922277.8 lps (10.0 s, 7 samples)
Pipe-based Context Switching 220083.6 lps (10.0 s, 7 samples)
Process Creation 9371.5 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 6539.0 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 833.4 lpm (60.0 s, 2 samples)
System Call Overhead 3046579.9 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 29489596.2 2527.0
Double-Precision Whetstone 55.0 4058.0 737.8
Execl Throughput 43.0 3397.3 790.1
File Copy 1024 bufsize 2000 maxblocks 3960.0 760398.7 1920.2
File Copy 256 bufsize 500 maxblocks 1655.0 232625.7 1405.6
File Copy 4096 bufsize 8000 maxblocks 5800.0 1571524.4 2709.5
Pipe Throughput 12440.0 1922277.8 1545.2
Pipe-based Context Switching 4000.0 220083.6 550.2
Process Creation 126.0 9371.5 743.8
Shell Scripts (1 concurrent) 42.4 6539.0 1542.2
Shell Scripts (8 concurrent) 6.0 833.4 1389.1
System Call Overhead 15000.0 3046579.9 2031.1
========
System Benchmarks Index Score 1326.3
======= Script description and score comparison completed! =======
评论