51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 939|回复: 0
打印 上一主题 下一主题

[原创] 简单测试与验证之UnixBench

[复制链接]
  • TA的每日心情
    无聊
    昨天 09:05
  • 签到天数: 1023 天

    连续签到: 2 天

    [LV.10]测试总司令

    跳转到指定楼层
    1#
    发表于 2022-12-20 13:22:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    目标
    飞腾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/kdlu ... 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内存
    1. System Benchmarks Index Values               BASELINE       RESULT    INDEX
    2.   Dhrystone 2 using register variables         116700.0   45321616.5   3883.6
    3.   Double-Precision Whetstone                       55.0       3994.4    726.3
    4.   Execl Throughput                                 43.0        990.5    230.3
    5.   File Copy 1024 bufsize 2000 maxblocks          3960.0     653004.6   1649.0
    6.   File Copy 256 bufsize 500 maxblocks            1655.0     170341.0   1029.3
    7.   File Copy 4096 bufsize 8000 maxblocks          5800.0    1991790.6   3434.1
    8.   Pipe Throughput                               12440.0     812102.4    652.8
    9.   Pipe-based Context Switching                   4000.0     129430.3    323.6
    10.   Process Creation                                126.0       2688.8    213.4
    11.   Shell Scripts (1 concurrent)                     42.4       2276.7    536.9
    12.   Shell Scripts (8 concurrent)                      6.0       1225.2   2042.0
    13.   System Call Overhead                          15000.0     656542.4    437.7
    14.                                                                      ========
    15.   System Benchmarks Index Score                                         811.8
    16.   ------------------------------------------------------------------------
    17.   Benchmark Run: 日 9月 25 2022 17:19:07 - 17:19:07
    18.   144 CPUs in system; running 144 parallel copies of tests
    复制代码


    ·Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz62 32G内存
    1. System Benchmarks Index Values               BASELINE       RESULT    INDEX
    2.   Dhrystone 2 using register variables         116700.0   26845867.5   2300.4
    3.   Double-Precision Whetstone                       55.0       3161.6    574.8
    4.   Execl Throughput                                 43.0       1477.6    343.6
    5.   File Copy 1024 bufsize 2000 maxblocks          3960.0     253582.3    640.4
    6.   File Copy 256 bufsize 500 maxblocks            1655.0      67713.4    409.1
    7.   File Copy 4096 bufsize 8000 maxblocks          5800.0     731087.8   1260.5
    8.   Pipe Throughput                               12440.0     322218.7    259.0
    9.   Pipe-based Context Switching                   4000.0      95001.7    237.5
    10.   Process Creation                                126.0       5645.1    448.0
    11.   Shell Scripts (1 concurrent)                     42.4       3719.6    877.3
    12.   Shell Scripts (8 concurrent)                      6.0       1646.3   2743.9
    13.   System Call Overhead                          15000.0     211672.9    141.1
    14.                                                                      ========
    15.   System Benchmarks Index Score                                         578.5
    16.   ------------------------------------------------------------------------
    17.   Benchmark Run: 日 9月 25 2022 17:25:56 - 17:25:56
    18.   24 CPUs in system; running 24 parallel copies of tests
    复制代码


    ·FT-2000+/64 2.0Ghz * 64core * 1 128G内存
    1.  System Benchmarks Index Values               BASELINE       RESULT    INDEX
    2.   Dhrystone 2 using register variables         116700.0   22368348.8   1916.7
    3.   Double-Precision Whetstone                       55.0       3631.2    660.2
    4.   Execl Throughput                                 43.0       2535.4    589.6
    5.   File Copy 1024 bufsize 2000 maxblocks          3960.0     403977.6   1020.1
    6.   File Copy 256 bufsize 500 maxblocks            1655.0     123146.9    744.1
    7.   File Copy 4096 bufsize 8000 maxblocks          5800.0    1059038.5   1825.9
    8.   Pipe Throughput                               12440.0     731953.9    588.4
    9.   Pipe-based Context Switching                   4000.0     128939.1    322.3
    10.   Process Creation                                126.0       5281.5    419.2
    11.   Shell Scripts (1 concurrent)                     42.4       3729.0    879.5
    12.   Shell Scripts (8 concurrent)                      6.0       1687.8   2813.0
    13.   System Call Overhead                          15000.0     512275.3    341.5
    14.                                                                      ========
    15.   System Benchmarks Index Score                                         800.7
    16.   ------------------------------------------------------------------------
    17.   Benchmark Run: 日 9月 25 2022 17:27:32 - 17:27:32
    18.   64 CPUs in system; running 64 parallel copies of tests
    复制代码


    · 虚拟机 Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz *8vCPU 16G内存
    1.  System Benchmarks Index Values               BASELINE       RESULT    INDEX
    2.   Dhrystone 2 using register variables         116700.0  211612119.4  18133.0
    3.   Double-Precision Whetstone                       55.0      35513.7   6457.0
    4.   Execl Throughput                                 43.0       7928.8   1843.9
    5.   File Copy 1024 bufsize 2000 maxblocks          3960.0    1008598.8   2547.0
    6.   File Copy 256 bufsize 500 maxblocks            1655.0     280047.4   1692.1
    7.   File Copy 4096 bufsize 8000 maxblocks          5800.0    3083540.8   5316.4
    8.   Pipe Throughput                               12440.0    6476970.5   5206.6
    9.   Pipe-based Context Switching                   4000.0    1522650.6   3806.6
    10.   Process Creation                                126.0      29679.7   2355.5
    11.   Shell Scripts (1 concurrent)                     42.4      21083.6   4972.6
    12.   Shell Scripts (8 concurrent)                      6.0       3255.8   5426.4
    13.   System Call Overhead                          15000.0    4443744.9   2962.5
    14.                                                                      ========
    15.   System Benchmarks Index Score                                        4032.0
    16.   只进行一个copy的性能为: Run -c 1
    17.   System Benchmarks Index Values               BASELINE       RESULT    INDEX
    18.   Dhrystone 2 using register variables         116700.0   34026972.9   2915.8
    19.   Double-Precision Whetstone                       55.0       4072.9    740.5
    20.   Execl Throughput                                 43.0       2797.2    650.5
    21.   File Copy 1024 bufsize 2000 maxblocks          3960.0     747208.9   1886.9
    22.   File Copy 256 bufsize 500 maxblocks            1655.0     208899.4   1262.2
    23.   File Copy 4096 bufsize 8000 maxblocks          5800.0    1819202.2   3136.6
    24.   Pipe Throughput                               12440.0    1148215.4    923.0
    25.   Pipe-based Context Switching                   4000.0     132960.3    332.4
    26.   Process Creation                                126.0       7724.1    613.0
    27.   Shell Scripts (1 concurrent)                     42.4       6659.2   1570.6
    28.   Shell Scripts (8 concurrent)                      6.0       2005.4   3342.3
    29.   System Call Overhead                          15000.0    2023562.5   1349.0
    30.                                                                      ========
    31.   System Benchmarks Index Score                                        1245.8
    复制代码


    · KVM虚拟机 FT-2000+/64 *12 32G内存
    1. System Benchmarks Index Values               BASELINE       RESULT    INDEX
    2.   Dhrystone 2 using register variables         116700.0  230828135.7  19779.6
    3.   Double-Precision Whetstone                       55.0      43293.8   7871.6
    4.   Execl Throughput                                 43.0      12516.6   2910.8
    5.   File Copy 1024 bufsize 2000 maxblocks          3960.0     337653.1    852.7
    6.   File Copy 256 bufsize 500 maxblocks            1655.0      88730.2    536.1
    7.   File Copy 4096 bufsize 8000 maxblocks          5800.0    1151598.8   1985.5
    8.   Pipe Throughput                               12440.0    6932899.9   5573.1
    9.   Pipe-based Context Switching                   4000.0     839878.7   2099.7
    10.   Process Creation                                126.0      14315.2   1136.1
    11.   Shell Scripts (1 concurrent)                     42.4      14834.8   3498.8
    12.   Shell Scripts (8 concurrent)                      6.0       2267.5   3779.1
    13.   System Call Overhead                          15000.0    1072451.9    715.0
    14.                                                                      ========
    15.   System Benchmarks Index Score                                        2470.5
    16.   只进行一个copy的性能为:
    17.   System Benchmarks Index Values               BASELINE       RESULT    INDEX
    18.   Dhrystone 2 using register variables         116700.0   22350448.1   1915.2
    19.   Double-Precision Whetstone                       55.0       3610.6    656.5
    20.   Execl Throughput                                 43.0       2140.6    497.8
    21.   File Copy 1024 bufsize 2000 maxblocks          3960.0     361175.9    912.1
    22.   File Copy 256 bufsize 500 maxblocks            1655.0     107413.0    649.0
    23.   File Copy 4096 bufsize 8000 maxblocks          5800.0     998342.8   1721.3
    24.   Pipe Throughput                               12440.0     689464.3    554.2
    25.   Pipe-based Context Switching                   4000.0      45415.8    113.5
    26.   Process Creation                                126.0       3255.5    258.4
    27.   Shell Scripts (1 concurrent)                     42.4       3168.9    747.4
    28.   Shell Scripts (8 concurrent)                      6.0       1299.4   2165.6
    29.   System Call Overhead                          15000.0     472585.1    315.1
    30.                                                                      ========
    31.   System Benchmarks Index Score                                         646.1
    复制代码




    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-9-25 02:26 , Processed in 0.065344 second(s), 24 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表