CentOS用unixbench 5.1.3测试linux性能

  unixbench是linux下面常用的跑分软件,用于测试linux性能

下面是Centos7.6测试cpu性能

安装运行命令

   安装编译环境

yum install make gcc gcc-c automake autoconf libtool gcc-c++ time perl-Time-HiRes SDL-devel mesa-libGL-devel  -y

解压
tar xzf UnixBench5.1.3.tgz

(说明:unixbench5包含system和graphic测试,如果你需要测试graphic,则需要修改Makefile,不要注释掉"GRAPHIC_TESTS = defined,同时需要系统提供x11perf命令gl_glibs库。反之,请将Makefile文件中GRAPHICS_TEST = defined注释掉,然后编译运行。)

修改Makefile
cd UnixBench
sed -i "s/GRAPHIC_TESTS = defined/#GRAPHIC_TESTS = defined/g" ./Makefile

make安装
执行测试  ./Run
(如果出现错误-bash: ./Run: /usr/bin/perl: bad interpreter: No such file or directory。输入yum groupinstall "Perl Support"即可)

使用方法

执行system测试方法:Run

执行graphic测试方法:Run graphics

执行system,graphics测试方法:Run gindex

 

Run参数用法:

   Run [ -q | -v ] [-i <n> ] [-c <n> [-c <n> ...]] [test ...]

选项说明:

-q          不显示测试过程

-v           显示测试过程

-i <count>    执行次数,最低3次,默认10

-c <n>           每次测试并行n个copies(并行任务)

对于多cpu系统的性能测试策略,需要统计单任务,多任务及其并行的性能增强。

以4个cpu的PC为例,需要测试两次,4个CPU就是要并行执行4个copies,

例:Run -q -c 1 -c 4


 .............

例如下面是E3-1230v5测试结果

BYTE UNIX Benchmarks (Version 5.1.3)

System: localhost.localdomain: GNU/Linux
OS: GNU/Linux -- 3.10.0-957.el7.x86_64 -- #1 SMP Thu Nov 8 23:39:32 UTC 2018
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (6816.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 1: Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (6816.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 2: Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (6816.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 3: Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (6816.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 4: Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (6816.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 5: Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (6816.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 6: Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (6816.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
CPU 7: Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (6816.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
23:03:05 up 5:38, 3 users, load average: 0.05, 0.22, 2.34; runlevel 5

------------------------------------------------------------------------
Benchmark Run: Sun Apr 25 2021 23:03:05 - 23:32:02
8 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables 47330693.0 lps (10.0 s, 7 samples)
Double-Precision Whetstone 3549.9 MWIPS (15.6 s, 7 samples)
Execl Throughput 1332.7 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 450849.1 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 113806.0 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1532608.9 KBps (30.0 s, 2 samples)
Pipe Throughput 529575.4 lps (10.0 s, 7 samples)
Pipe-based Context Switching 172217.4 lps (10.0 s, 7 samples)
Process Creation 12174.7 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 6063.9 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 2934.1 lpm (60.0 s, 2 samples)
System Call Overhead 362424.9 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 47330693.0 4055.8
Double-Precision Whetstone 55.0 3549.9 645.4
Execl Throughput 43.0 1332.7 309.9
File Copy 1024 bufsize 2000 maxblocks 3960.0 450849.1 1138.5
File Copy 256 bufsize 500 maxblocks 1655.0 113806.0 687.6
File Copy 4096 bufsize 8000 maxblocks 5800.0 1532608.9 2642.4
Pipe Throughput 12440.0 529575.4 425.7
Pipe-based Context Switching 4000.0 172217.4 430.5
Process Creation 126.0 12174.7 966.2
Shell Scripts (1 concurrent) 42.4 6063.9 1430.2
Shell Scripts (8 concurrent) 6.0 2934.1 4890.1
System Call Overhead 15000.0 362424.9 241.6
========
System Benchmarks Index Score 944.2  (单核性能)

------------------------------------------------------------------------
Benchmark Run: Sun Apr 25 2021 23:32:02 - 00:00:08
8 CPUs in system; running 8 parallel copies of tests

Dhrystone 2 using register variables 195551422.7 lps (10.0 s, 7 samples)
Double-Precision Whetstone 36210.8 MWIPS (10.3 s, 7 samples)
Execl Throughput 17283.2 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 1172264.0 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 301906.8 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 3877432.4 KBps (30.0 s, 2 samples)
Pipe Throughput 2583778.3 lps (10.0 s, 7 samples)
Pipe-based Context Switching 836533.6 lps (10.0 s, 7 samples)
Process Creation 62177.1 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 27820.9 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 3813.5 lpm (60.1 s, 2 samples)
System Call Overhead 1668708.7 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 195551422.7 16756.8
Double-Precision Whetstone 55.0 36210.8 6583.8
Execl Throughput 43.0 17283.2 4019.3
File Copy 1024 bufsize 2000 maxblocks 3960.0 1172264.0 2960.3
File Copy 256 bufsize 500 maxblocks 1655.0 301906.8 1824.2
File Copy 4096 bufsize 8000 maxblocks 5800.0 3877432.4 6685.2
Pipe Throughput 12440.0 2583778.3 2077.0
Pipe-based Context Switching 4000.0 836533.6 2091.3
Process Creation 126.0 62177.1 4934.7
Shell Scripts (1 concurrent) 42.4 27820.9 6561.5
Shell Scripts (8 concurrent) 6.0 3813.5 6355.9
System Call Overhead 15000.0 1668708.7 1112.5
========
System Benchmarks Index Score 3982.5  (多核性能)

 

默认unixbench只支持到16cores,修改参数,取消此限制

sed -i "s/\"System Benchmarks\", 'maxCopies' => 16/\"System Benchmarks\", 'maxCopies' => 0/" Run

sed -i 's/$copies > $maxCopies/$maxCopies > 0 \&\& $copies > $maxCopies/' Run

 

下面是 AMD EPYC 7282 16-Core Processor (5589.5 bogomips) 跑分

 

 .......

单核跑分:

System Benchmarks Index Score                                        1332.0

 

 多核跑分:

System Benchmarks Index Score                                       11523.5

 

 

 

 

 

结果仅供参考:
一般单核跑分1000+为优秀, 800+为一般, 500- 为差



参考:
https://blog.csdn.net/weixin_30617561/article/details/95073381
https://blog.csdn.net/qq_36357820/article/details/79959445

posted @ 2021-04-25 16:40  祝福满地  阅读(2288)  评论(0编辑  收藏  举报