UnixBench的简单测试与验证

发表于:2022-12-20 09:35

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:济南小老虎    来源:博客园

  目标
  飞腾2000+ (物理机和虚拟机)
  Intel Golden 6170  物理机 
  Intel Golden 5218  虚拟机 Gold 5218 CPU @ 2.30GHz
  至强十年前的CPU  E5-2620    物理机
  E5-2630 v3 @ 2.40GHz       虚拟机
  验证一下不同机器的最简单的性能数据.
  过程
  第一步 下载UnixBench
  https://codeload.github.com/kdlucas/byte-unixbench/tar.gz/refs/tags/v5.1.3
  下载完后 该改名, 放到不同的机器里面
  tar -zxvf unixbench-5.1.3.tar.gz
  cd byte-unixbench-5.1.3/UnixBench/
  sed -i "s/GRAPHIC_TESTS = defined/#GRAPHIC_TESTS = defined/g" ./Makefile
  make
  执行命令为:
  ./Run
  简单参数介绍
  ·StudyFrom: https://yuntue.com/post/29354.html
  简单参数介绍文字版
  Unixbench做了哪些性能测试
  Dhrystone 2 using register variables
  这里有比较详细的dhrystone介绍,这个主要是测整数性能,对应的浮点数测试是:Double-Precision Whetstone。
  那绕开里面一坨计算,说下输出:默认就是在10秒内,那一坨计算能计算次数,算出分数后,参考前面篇UnixBench算分介绍,算出Index分数。
  Double-Precision Whetstone
  既然有整数运算的CPU性能,那么浮点数运算性能也希望有,于是就有了:whets.c 
  Execl Throughput
  除了前面介绍的那两个比较复杂,UnixBench其他的运算都比较简单,Execl它的实际就是递归调用,它主要利用的是execl函数。
  本身execl.c编译出来后的执行文件是execl的二进制文件,execl函数执行的时候记录参数:开始时间,执行次数,耗时(一般都是10秒)。
  当本次总执行时间耗时超过10秒时,输出执行次数,然后根据算分规则算分,这个思想还是很巧妙的。
  File Copy
  这个主要是测试的write和read两个函数,测试30秒。实现很简单,先写入一个文件2秒(循环写入),再读2秒,
  然后从刚刚写入的文件读取数据,写入到另一个文件,循环写入,在30秒的读写次数。 
  不同的参数测试测的是不同块大小,不同块数的性能,如果测试磁盘建议用FIO测试。
  Pipe Throughput
  打开一个管道,往管道写入512个bytes,再读出来,测试10秒,总共读写次数
  Pipe-based Context Switching
  打开两个管道,开启两个进程,其中一个进程往管道1写,往管道2读,另一个进程往管道2写,往管道2读,
  一个进程完成一次读写,计数+1。其中一个很有意思的事情:如果这两个进程在同一个CPU和不同的CPU有完全不同的性能,
  在同一个CPU下性能会好很多。这里有篇很细致的分析,值得大家评阅:Unixbench 测试套件缺陷深度分析
  Process Creation
  就是不停调用fork函数,创建进程,并立马退出,成功一次计数+1。
  Shell Scripts
  通过fork函数,创建进程,不停地执行一个脚本, 执行成功一次+1. 
  所谓Shell Scripts (1 concurrent) 一个并发是指传递给脚本:pgms/multi.sh 参数是1,
  同样Shell Scripts (8 concurrent) ,传递给脚本的参数是8,同时8个子任务并发执行。
  System Call Overhead
  本意是想计算进入离开操作系统的开销,进入离开一次计数+1,
  在10秒内的执行次数. 实际执行的效果是fork子进程,waitpid函数后退出,计数+1
  部分机器的配置与结果
  · Intel(R) Xeon(R) Gold 6150 CPU @ 2.70GHz * 18 *4 1T内存
  System Benchmarks Index Values               BASELINE       RESULT    INDEX
  Dhrystone 2 using register variables         116700.0   45321616.5   3883.6
  Double-Precision Whetstone                       55.0       3994.4    726.3
  Execl Throughput                                 43.0        990.5    230.3
  File Copy 1024 bufsize 2000 maxblocks          3960.0     653004.6   1649.0
  File Copy 256 bufsize 500 maxblocks            1655.0     170341.0   1029.3
  File Copy 4096 bufsize 8000 maxblocks          5800.0    1991790.6   3434.1
  Pipe Throughput                               12440.0     812102.4    652.8
  Pipe-based Context Switching                   4000.0     129430.3    323.6
  Process Creation                                126.0       2688.8    213.4
  Shell Scripts (1 concurrent)                     42.4       2276.7    536.9
  Shell Scripts (8 concurrent)                      6.0       1225.2   2042.0
  System Call Overhead                          15000.0     656542.4    437.7
                                                                     ========
  System Benchmarks Index Score                                         811.8
  ------------------------------------------------------------------------
  Benchmark Run: 日 9月 25 2022 17:19:07 - 17:19:07
  144 CPUs in system; running 144 parallel copies of tests
  ·Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz62 32G内存
  System Benchmarks Index Values               BASELINE       RESULT    INDEX
  Dhrystone 2 using register variables         116700.0   26845867.5   2300.4
  Double-Precision Whetstone                       55.0       3161.6    574.8
  Execl Throughput                                 43.0       1477.6    343.6
  File Copy 1024 bufsize 2000 maxblocks          3960.0     253582.3    640.4
  File Copy 256 bufsize 500 maxblocks            1655.0      67713.4    409.1
  File Copy 4096 bufsize 8000 maxblocks          5800.0     731087.8   1260.5
  Pipe Throughput                               12440.0     322218.7    259.0
  Pipe-based Context Switching                   4000.0      95001.7    237.5
  Process Creation                                126.0       5645.1    448.0
  Shell Scripts (1 concurrent)                     42.4       3719.6    877.3
  Shell Scripts (8 concurrent)                      6.0       1646.3   2743.9
  System Call Overhead                          15000.0     211672.9    141.1
                                                                     ========
  System Benchmarks Index Score                                         578.5
  ------------------------------------------------------------------------
  Benchmark Run: 日 9月 25 2022 17:25:56 - 17:25:56
  24 CPUs in system; running 24 parallel copies of tests
  ·FT-2000+/64 2.0Ghz * 64core * 1 128G内存
  System Benchmarks Index Values               BASELINE       RESULT    INDEX
  Dhrystone 2 using register variables         116700.0   22368348.8   1916.7
  Double-Precision Whetstone                       55.0       3631.2    660.2
  Execl Throughput                                 43.0       2535.4    589.6
  File Copy 1024 bufsize 2000 maxblocks          3960.0     403977.6   1020.1
  File Copy 256 bufsize 500 maxblocks            1655.0     123146.9    744.1
  File Copy 4096 bufsize 8000 maxblocks          5800.0    1059038.5   1825.9
  Pipe Throughput                               12440.0     731953.9    588.4
  Pipe-based Context Switching                   4000.0     128939.1    322.3
  Process Creation                                126.0       5281.5    419.2
  Shell Scripts (1 concurrent)                     42.4       3729.0    879.5
  Shell Scripts (8 concurrent)                      6.0       1687.8   2813.0
  System Call Overhead                          15000.0     512275.3    341.5
                                                                     ========
  System Benchmarks Index Score                                         800.7
  ------------------------------------------------------------------------
  Benchmark Run: 日 9月 25 2022 17:27:32 - 17:27:32
  64 CPUs in system; running 64 parallel copies of tests
  · 虚拟机 Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz *8vCPU 16G内存
  System Benchmarks Index Values               BASELINE       RESULT    INDEX
  Dhrystone 2 using register variables         116700.0  211612119.4  18133.0
  Double-Precision Whetstone                       55.0      35513.7   6457.0
  Execl Throughput                                 43.0       7928.8   1843.9
  File Copy 1024 bufsize 2000 maxblocks          3960.0    1008598.8   2547.0
  File Copy 256 bufsize 500 maxblocks            1655.0     280047.4   1692.1
  File Copy 4096 bufsize 8000 maxblocks          5800.0    3083540.8   5316.4
  Pipe Throughput                               12440.0    6476970.5   5206.6
  Pipe-based Context Switching                   4000.0    1522650.6   3806.6
  Process Creation                                126.0      29679.7   2355.5
  Shell Scripts (1 concurrent)                     42.4      21083.6   4972.6
  Shell Scripts (8 concurrent)                      6.0       3255.8   5426.4
  System Call Overhead                          15000.0    4443744.9   2962.5
                                                                     ========
  System Benchmarks Index Score                                        4032.0
  只进行一个copy的性能为: Run -c 1
  System Benchmarks Index Values               BASELINE       RESULT    INDEX
  Dhrystone 2 using register variables         116700.0   34026972.9   2915.8
  Double-Precision Whetstone                       55.0       4072.9    740.5
  Execl Throughput                                 43.0       2797.2    650.5
  File Copy 1024 bufsize 2000 maxblocks          3960.0     747208.9   1886.9
  File Copy 256 bufsize 500 maxblocks            1655.0     208899.4   1262.2
  File Copy 4096 bufsize 8000 maxblocks          5800.0    1819202.2   3136.6
  Pipe Throughput                               12440.0    1148215.4    923.0
  Pipe-based Context Switching                   4000.0     132960.3    332.4
  Process Creation                                126.0       7724.1    613.0
  Shell Scripts (1 concurrent)                     42.4       6659.2   1570.6
  Shell Scripts (8 concurrent)                      6.0       2005.4   3342.3
  System Call Overhead                          15000.0    2023562.5   1349.0
                                                                     ========
  System Benchmarks Index Score                                        1245.8
  · KVM虚拟机 FT-2000+/64 *12 32G内存
  System Benchmarks Index Values               BASELINE       RESULT    INDEX
  Dhrystone 2 using register variables         116700.0  230828135.7  19779.6
  Double-Precision Whetstone                       55.0      43293.8   7871.6
  Execl Throughput                                 43.0      12516.6   2910.8
  File Copy 1024 bufsize 2000 maxblocks          3960.0     337653.1    852.7
  File Copy 256 bufsize 500 maxblocks            1655.0      88730.2    536.1
  File Copy 4096 bufsize 8000 maxblocks          5800.0    1151598.8   1985.5
  Pipe Throughput                               12440.0    6932899.9   5573.1
  Pipe-based Context Switching                   4000.0     839878.7   2099.7
  Process Creation                                126.0      14315.2   1136.1
  Shell Scripts (1 concurrent)                     42.4      14834.8   3498.8
  Shell Scripts (8 concurrent)                      6.0       2267.5   3779.1
  System Call Overhead                          15000.0    1072451.9    715.0
                                                                     ========
  System Benchmarks Index Score                                        2470.5
  只进行一个copy的性能为:
  System Benchmarks Index Values               BASELINE       RESULT    INDEX
  Dhrystone 2 using register variables         116700.0   22350448.1   1915.2
  Double-Precision Whetstone                       55.0       3610.6    656.5
  Execl Throughput                                 43.0       2140.6    497.8
  File Copy 1024 bufsize 2000 maxblocks          3960.0     361175.9    912.1
  File Copy 256 bufsize 500 maxblocks            1655.0     107413.0    649.0
  File Copy 4096 bufsize 8000 maxblocks          5800.0     998342.8   1721.3
  Pipe Throughput                               12440.0     689464.3    554.2
  Pipe-based Context Switching                   4000.0      45415.8    113.5
  Process Creation                                126.0       3255.5    258.4
  Shell Scripts (1 concurrent)                     42.4       3168.9    747.4
  Shell Scripts (8 concurrent)                      6.0       1299.4   2165.6
  System Call Overhead                          15000.0     472585.1    315.1
                                                                     ========
  System Benchmarks Index Score                                         646.1
  本文内容不用于商业目的,如涉及知识产权问题,请权利人联系51Testing小编(021-64471599-8017),我们将立即处理
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号