前段时间,我们回顾了 佛罗尼克斯,一个开源测试和基准测试平台。 在本指南中,我们将看到另一个名为 UnixBench. 它是最初的 BYTE UNIX 基准套件,多年来由许多人更新和修订。 该工具的主要目的是提供类 Unix 操作系统性能的基本指标。 UnixBench 可用于评估系统在运行单个或多个任务时的性能。 请注意,这是一个系统基准测试工具,而不仅仅是 CPU、RAM 或磁盘基准测试工具。 结果不仅取决于您的硬件,还取决于您的操作系统、库甚至编译器。
Unixbench 将在您的系统上进行以下基准测试。
- 干石 – 用于衡量和比较计算机的性能。
- 磨石 – 用于衡量浮点运算的速度和效率。
- 执行吞吐量 – 用于衡量每秒可以执行的 execl 调用次数。
- 文件复制 – 用于衡量数据从一个文件传输到另一个文件的速率。
- 管道吞吐量 – 进程可以将 512 字节写入管道并将其读回的次数(每秒)。
- 基于管道的上下文切换 – 用于衡量两个进程通过管道交换递增整数的次数。
- 流程创建 – 用于衡量一个进程可以分叉并收获一个立即退出的子进程的次数。
- 外壳脚本 – 用于衡量一个进程每分钟可以启动并获得一组八个并发的 shell 脚本副本的次数,其中 shell 脚本将一系列转换应用于数据文件。
- 系统调用开销 – 用于估算进入和离开操作系统内核的成本。
- 图形测试 – 用于提供系统 2D 和 3D 图形性能的概念。
下载 – 免费电子书:“Vim 备忘单”
在 Linux 上安装和使用 Unixbench
UnixBench 在 AUR 中可用,因此您可以使用 AUR 助手将其安装在 Arch Linux 及其衍生产品如 Manjaro Linux、Antergos 上。
使用 耶:
$ yay -S unixbench
在其他 Linux 发行版上,您需要手动编译和安装 UnixBench,如下所示。
在 CentOS、RHEL、 Fedora:
$ sudo yum -y install gcc gcc-c++ make libXext-devel perl perl-Time-HiRes git
$ sudo yum -y groupinstall "Development Tools"
$ sudo yum -y install libX11-devel mesa-libGL-devel perl-Time-HiRes
在 Debian、Ubuntu、Linux Mint 上:
$ sudo apt-get install libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make git
安装必要的先决条件后,使用命令 git clone UnixBench 存储库:
$ git clone https://github.com/kdlucas/byte-unixbench.git
转到 unixbench 目录:
$ cd byte-unixbench/UnixBench/
然后,运行以下命令开始对系统进行基准测试。
$ ./Run
如果您在 Arch Linux 上从 AUR 安装了 UnixBench,请运行以下命令来启动它。
$ ubench
示例输出为:
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 4 x Dhrystone 2 using register variables 1 2 3 4 5 6 7 8 9 10 4 x Double-Precision Whetstone 1 2 3 4 5 6 7 8 9 10 4 x Execl Throughput 1 2 3 4 x File Copy 1024 bufsize 2000 maxblocks 1 2 3 4 x File Copy 256 bufsize 500 maxblocks 1 2 3 4 x File Copy 4096 bufsize 8000 maxblocks 1 2 3 4 x Pipe Throughput 1 2 3 4 5 6 7 8 9 10 4 x Pipe-based Context Switching 1 2 3 4 5 6 7 8 9 10 4 x Process Creation 1 2 3 4 x System Call Overhead 1 2 3 4 5 6 7 8 9 10 4 x Shell Scripts (1 concurrent) 1 2 3 4 x Shell Scripts (8 concurrent) 1 2 3 ======================================================================== BYTE UNIX Benchmarks (Version 5.1.3) System: sk: GNU/Linux OS: GNU/Linux -- 4.10.10-1-ARCH -- #1 SMP PREEMPT Wed Apr 12 18:50:28 CEST 2017 Machine: x86_64 (unknown) Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8") CPU 0: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (4591.9 bogomips) Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization CPU 1: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (4592.1 bogomips) Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization CPU 2: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (4593.8 bogomips) Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization CPU 3: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz (4592.2 bogomips) Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization 13:09:04 up 1:56, 1 user, load average: 0.55, 0.37, 0.42; runlevel unknown ------------------------------------------------------------------------ Benchmark Run: Wed Apr 19 2017 13:09:04 - 13:38:10 4 CPUs in system; running 1 parallel copy of tests Dhrystone 2 using register variables 19547861.3 lps (10.0 s, 7 samples) Double-Precision Whetstone 2321.8 MWIPS (13.9 s, 7 samples) Execl Throughput 2982.7 lps (29.5 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks 493713.2 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 150353.3 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 760514.6 KBps (30.1 s, 2 samples) Pipe Throughput 1128068.6 lps (10.0 s, 7 samples) Pipe-based Context Switching 97761.1 lps (10.0 s, 7 samples) Process Creation 4560.7 lps (30.0 s, 2 samples) Shell Scripts (1 concurrent) 1802.4 lpm (60.0 s, 2 samples) Shell Scripts (8 concurrent) 476.7 lpm (60.1 s, 2 samples) System Call Overhead 1752928.0 lps (10.0 s, 7 samples) System Benchmarks Index Values BASELINE RESULT INDEX Dhrystone 2 using register variables 116700.0 19547861.3 1675.1 Double-Precision Whetstone 55.0 2321.8 422.2 Execl Throughput 43.0 2982.7 693.6 File Copy 1024 bufsize 2000 maxblocks 3960.0 493713.2 1246.8 File Copy 256 bufsize 500 maxblocks 1655.0 150353.3 908.5 File Copy 4096 bufsize 8000 maxblocks 5800.0 760514.6 1311.2 Pipe Throughput 12440.0 1128068.6 906.8 Pipe-based Context Switching 4000.0 97761.1 244.4 Process Creation 126.0 4560.7 362.0 Shell Scripts (1 concurrent) 42.4 1802.4 425.1 Shell Scripts (8 concurrent) 6.0 476.7 794.5 System Call Overhead 15000.0 1752928.0 1168.6 ======== System Benchmarks Index Score 730.4 ------------------------------------------------------------------------ Benchmark Run: Wed Apr 19 2017 13:38:10 - 14:07:31 4 CPUs in system; running 4 parallel copies of tests Dhrystone 2 using register variables 27193072.8 lps (10.0 s, 7 samples) Double-Precision Whetstone 4985.4 MWIPS (16.4 s, 7 samples) Execl Throughput 4453.8 lps (29.8 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks 340833.2 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 74310.1 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 886922.2 KBps (30.0 s, 2 samples) Pipe Throughput 1467621.9 lps (10.0 s, 7 samples) Pipe-based Context Switching 324277.3 lps (10.0 s, 7 samples) Process Creation 10722.5 lps (30.0 s, 2 samples) Shell Scripts (1 concurrent) 2893.2 lpm (60.1 s, 2 samples) Shell Scripts (8 concurrent) 400.8 lpm (60.2 s, 2 samples) System Call Overhead 2750243.4 lps (10.0 s, 7 samples) System Benchmarks Index Values BASELINE RESULT INDEX Dhrystone 2 using register variables 116700.0 27193072.8 2330.2 Double-Precision Whetstone 55.0 4985.4 906.4 Execl Throughput 43.0 4453.8 1035.8 File Copy 1024 bufsize 2000 maxblocks 3960.0 340833.2 860.7 File Copy 256 bufsize 500 maxblocks 1655.0 74310.1 449.0 File Copy 4096 bufsize 8000 maxblocks 5800.0 886922.2 1529.2 Pipe Throughput 12440.0 1467621.9 1179.8 Pipe-based Context Switching 4000.0 324277.3 810.7 Process Creation 126.0 10722.5 851.0 Shell Scripts (1 concurrent) 42.4 2893.2 682.4 Shell Scripts (8 concurrent) 6.0 400.8 668.0 System Call Overhead 15000.0 2750243.4 1833.5 ======== System Benchmarks Index Score 989.4
基准分数将显示在结果的末尾。
而且,这就是现在的全部。 希望您觉得这个有帮助。 如果您喜欢我们的工作,请在您的社交、专业网络上分享我们的指南并支持 OSTechNix。
干杯!
资源:
感谢您的光临!
帮助我们帮助您:
- 订阅我们的电子邮件通讯: 立即注册
- 支持 OSTechNix: 通过贝宝捐款
- 下载免费的电子书和视频: TradePub 上的 OSTechNix
- 联系我们: Facebook | Twitter | 谷歌加 | 领英 | RSS订阅
祝你有美好的一天!!