[喵咪开源软件推荐(4)]Liunx跑分神器-unixbench

10 阅读 作者:喵了个咪__ 2020-05-11

哈喽大家好呀! 这次给大家带来一个Liunx跑分神奇,在笔者在老早之前有听到一则传闻,阿里云相同的配置性能有差异 有的是X5的有的是E5的档次各有不同,然后有人开了100台阿里Liunx的机器,在里面选出了4台性能最好的时候,那个时候我就在纳闷Windows可以通过鲁大师CPU-Z的跑分,Liunx怎么跑分呢?这次就为大家带来Liunx跑分神奇unixbench.

附上:

喵了个咪的博客:w-blog.cn

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

1.了解unixbench

UnixBench是一款开源的测试 unix 系统基本性能的工具,是比较通用的测试VPS性能的工具。

UnixBench会测试系统各个方面一系列的性能,然后将每个测试结果和一个基准值进行比较,得到一个索引值,所有测试项目的索引值结合在一起形成一个测试分数值.

UnixBench也支持多CPU系统的测试,默认的行为是测试两次,第一次是一个进程的测试,第二次是N份测试,N等于CPU个数。

基本测试项如下:

  • 简单的2D和3D图形测试
  • 测试系统的单任务性能
  • 测试系统的多任务性能
  • 测试系统并行处理的能力
  • CPU,内存,或者磁盘

UnixBench一个基于系统的基准测试工具,不单纯是CPU 内存 或者磁盘测试工具。测试结果不仅仅取决于硬件,也取决于系统、开发库、甚至是编译器。

UnixBench测试执行完大约需要10-30分钟.

2.安装使用

wget http://soft.laozuo.org/scripts/UnixBench5.1.3.tgz
tar xf UnixBench5.1.3.tgz
cd UnixBench
make
./Run

这是使用UnixBench5.1.3默认不进行图像测试测试,如果是更早的版本需要注意注释掉图像测试不然会不允许运行:

# 无需图像测试
vim Makefile 
# 注释掉 GRAPHIC_TESTS = defined
./Run #开始跑分

# 异常问题汇总
1.缺少gcc或c++
yum install gcc gcc_c++
2.报错如/src/ubgears.c:48:22: error: X11/Xlib.h: No such file or directory
./src/ubgears.c:49:23: error: X11/Xutil.h: No such file or directory
./src/ubgears.c:50:24: error: X11/keysym.h: No such file or directory
./src/ubgears.c:51:19: error: GL/gl.h: No such file or directory
./src/ubgears.c:52:20: error: GL/glx.h: No such file or directory
yum install xorg-x11* 
3.报错如/usr/bin/ld: cannot find -lXext
ln -s /usr/lib64/libXext.so.6.4.0 /usr/lib/libXext.so
4.Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./Run line 6. BEGIN failed--compilation aborted at ./Run line 6.
yum install perl-Time-HiRes

也可以通过一键脚本执行测试

wget http://www.vpsmark.com/sh/unixbench.sh
sh ./unixbench.sh

UnixBench会更具机器核心数进行单核到多核的测试,如果只有一个核心只会进行单核测试,下面是阿里云单核1G云主机的测试

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   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
..........过程省略
Benchmark Run: Fri Apr 07 2017 19:45:29 - 20:13:31
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       29585257.5 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     4482.2 MWIPS (9.8 s, 7 samples)
Execl Throughput                               4348.9 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        924016.8 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          242952.9 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       2585826.2 KBps  (30.0 s, 2 samples)
Pipe Throughput                             1486598.7 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 322716.3 lps   (10.0 s, 7 samples)
Process Creation                              16792.4 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   5959.1 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    804.3 lpm   (60.1 s, 2 samples)
System Call Overhead                        2482379.7 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   29585257.5   2535.2
Double-Precision Whetstone                       55.0       4482.2    815.0
Execl Throughput                                 43.0       4348.9   1011.4
File Copy 1024 bufsize 2000 maxblocks          3960.0     924016.8   2333.4
File Copy 256 bufsize 500 maxblocks            1655.0     242952.9   1468.0
File Copy 4096 bufsize 8000 maxblocks          5800.0    2585826.2   4458.3
Pipe Throughput                               12440.0    1486598.7   1195.0
Pipe-based Context Switching                   4000.0     322716.3    806.8
Process Creation                                126.0      16792.4   1332.7
Shell Scripts (1 concurrent)                     42.4       5959.1   1405.5
Shell Scripts (8 concurrent)                      6.0        804.3   1340.4
System Call Overhead                          15000.0    2482379.7   1654.9
                                                                   ========
System Benchmarks Index Score                                        1498.1

下面是macbookpro虚拟2核心2G跑分可以看到差距还是挺大的

Benchmark Run: Fri Apr 07 2017 20:16:35 - 20:46:22
2 CPUs in system; running 2 parallel copies of tests

Dhrystone 2 using register variables       80339506.0 lps   (10.5 s, 7 samples)
Double-Precision Whetstone                     7093.4 MWIPS (13.9 s, 7 samples)
Execl Throughput                               4520.2 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks       1539490.5 KBps  (31.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          406417.1 KBps  (31.5 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       4557946.6 KBps  (30.9 s, 2 samples)
Pipe Throughput                             4100218.8 lps   (11.0 s, 7 samples)
Pipe-based Context Switching                 775848.8 lps   (10.5 s, 7 samples)
Process Creation                              26732.6 lps   (31.0 s, 2 samples)
Shell Scripts (1 concurrent)                   7841.0 lpm   (62.9 s, 2 samples)
Shell Scripts (8 concurrent)                   1208.6 lpm   (60.9 s, 2 samples)
System Call Overhead                        5413108.9 lps   (10.5 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   80339506.0   6884.3
Double-Precision Whetstone                       55.0       7093.4   1289.7
Execl Throughput                                 43.0       4520.2   1051.2
File Copy 1024 bufsize 2000 maxblocks          3960.0    1539490.5   3887.6
File Copy 256 bufsize 500 maxblocks            1655.0     406417.1   2455.7
File Copy 4096 bufsize 8000 maxblocks          5800.0    4557946.6   7858.5
Pipe Throughput                               12440.0    4100218.8   3296.0
Pipe-based Context Switching                   4000.0     775848.8   1939.6
Process Creation                                126.0      26732.6   2121.6
Shell Scripts (1 concurrent)                     42.4       7841.0   1849.3
Shell Scripts (8 concurrent)                      6.0       1208.6   2014.3
System Call Overhead                          15000.0    5413108.9   3608.7
                                                                   ========
System Benchmarks Index Score                                        2663.8

3 总结

通过unixbench可以很好的对Liunx服务综合性能进行评估,可以帮助大家在购买云主机也好还是对物理主机进行完整的测试,今天就到这里了下次再见!

注:笔者能力有限有说的不对的地方希望大家能够指出,也希望多多交流!

点击查看更多内容
原文地址:https://www.imooc.com/article/300632
广告一下
热门教程
PHP7报A non well formed numeric value encountered 0
Linux系统下关闭mongodb的几种命令分享 0
mongodb删除数据、删除集合、删除数据库的命令 0
Git&Github极速入门与攻坚实战课程 0
python爬虫教程使用Django和scrapy实现 0
libnetsnmpmibs.so.31: cannot open shared object file 0
数据结构和算法视频教程 0
redis的hash结构怎么删除数据呢? 0
C++和LUA解析器的数据交互实战视频 0
mongodb errmsg" : "too many users are authenticated 0
C++基础入门视频教程 0
用30个小时精通C++视频教程可能吗? 0
C++分布式多线程游戏服务器开发视频教程socket tcp boost库 0
C++培训教程就业班教程 0
layui的util工具格式时间戳为字符串 0
C++实战教程之远程桌面远程控制实战 1
网络安全培训视频教程 0
LINUX_C++软件工程师视频教程高级项目实战 0
C++高级数据结构与算法视频教程 0
跨域问题很头疼?通过配置nginx轻松解决ajax跨域问题 0
相关文章
【译】JavaScript数据结构(3):单向链表与双向链表 16
10个JavaScript难点 16
【译】苹果拒绝支持PWA,有损Web的未来 16
iView 一周年了,同时发布了 2.0 正式版,但这只是开始... 16
nodejs+mongodb构建一个简单登录注册功能 16
【译】JavaScript数据结构(4):树 16
组件化开发与黑箱 16
TypeScript - 不止稳,而且快 16
webpack3+anujs+ReactCSSTransitionGroup 16
原生js实现图片放大镜效果 16
WEB缓存探究第二弹——实战 16
纯笔记:vfork 的一些使用场景(顺便讲一下 fork 的原理) 16
Android APP 内部捐赠实现(支付宝&微信) 16
WKWebView 的一些小总结 16
模型评价(一) AUC大法 16
开始使用GraphQL 16
Webpack模块化原理简析 16
gulp使用问题记录 16
使用Angular4动画为页面添彩 16
Python27 Matplotlib (win64 python2.7) 安装及简单使用 16