Friday, October 18, 2019

Some Popular Linux VPS Bench Scripts



Cloud service providers often define host tiers by the allocated resources, but the differences in the underlying hardware, architecture and performance tuning can result in varying capabilities even between similar configurations. The easiest way to measure the real differences between servers is to run a set of tests, i.e. a benchmark, to create simple to read values for comparisons.


UnixBench

    UnixBench is the original BYTE UNIX benchmark suite, updated and revised by many people over the years.The purpose of UnixBench is to provide a basic indicator of the performance of a Unix-like system. Hence, multiple tests are used to test various aspects of the system’s performance. These test results are then compared to the scores from a baseline system to produce an index value, which is generally easier to handle than the raw scores. The entire set of index values is then combined to make an overall index for the system.
    Some very simple graphics tests are included to measure the 2D and 3D graphics performance of the system.

    UnixBench Benchmark repository is at https://github.com/cloudharmony/unixbench



    Installation commands:


    # Ubuntu
    cd ~
    sudo apt-get -y install gcc php5-cli
    wget https://s3.amazonaws.com/cloudbench/software/UnixBench5.1.3.tgz
    tar zxf UnixBench5.1.3.tgz
    cd UnixBench
    make all
    ./Run

    # CentOS
    cd ~
    sudo yum -y install gcc php-cli
    wget https://s3.amazonaws.com/cloudbench/software/UnixBench5.1.3.tgz
    tar zxf UnixBench5.1.3.tgz
    cd UnixBench
    make all ./Run




    [[email protected] ~]# cd ~
    [[email protected] ~]# sudo yum -y install gcc php-cli
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.serenitytek.com
     * epel: mirror.steadfastnet.com
     * extras: mirrors.cmich.edu
     * updates: centos4.zswap.net
    Resolving Dependencies
    --> Running transaction check
    ---> Package gcc.x86_64 0:4.8.5-39.el7 will be installed
    --> Processing Dependency: cpp = 4.8.5-39.el7 for package: gcc-4.8.5-39.el7.x86_64
    --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-39.el7.x86_64
    --> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-39.el7.x86_64
    --> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-39.el7.x86_64
    ---> Package php-cli.x86_64 0:5.4.16-46.el7 will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.16-46.el7 for package: php-cli-5.4.16-46.el7.x86_64
    --> Running transaction check
    ---> Package cpp.x86_64 0:4.8.5-39.el7 will be installed
    ---> Package glibc-devel.x86_64 0:2.17-292.el7 will be installed
    --> Processing Dependency: glibc-headers = 2.17-292.el7 for package: glibc-devel-2.17-292.el7.x86_64
    --> Processing Dependency: glibc-headers for package: glibc-devel-2.17-292.el7.x86_64
    ---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
    ---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
    ---> Package php-common.x86_64 0:5.4.16-46.el7 will be installed
    --> Processing Dependency: libzip.so.2()(64bit) for package: php-common-5.4.16-46.el7.x86_64
    --> Running transaction check
    ---> Package glibc-headers.x86_64 0:2.17-292.el7 will be installed
    --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-292.el7.x86_64
    --> Processing Dependency: kernel-headers for package: glibc-headers-2.17-292.el7.x86_64
    ---> Package libzip.x86_64 0:0.10.1-8.el7 will be installed
    --> Running transaction check
    ---> Package kernel-headers.x86_64 0:3.10.0-1062.1.1.el7 will be installed
    --> Finished Dependency Resolution
    Dependencies Resolved
    
    ===================================================================================================================
     Package                      Arch                 Version                             Repository             Size
    ===================================================================================================================
    Installing:
     gcc                          x86_64               4.8.5-39.el7                        base                   16 M
     php-cli                      x86_64               5.4.16-46.el7                       base                  2.7 M
    Installing for dependencies:
     cpp                          x86_64               4.8.5-39.el7                        base                  5.9 M
     glibc-devel                  x86_64               2.17-292.el7                        base                  1.1 M
     glibc-headers                x86_64               2.17-292.el7                        base                  687 k
     kernel-headers               x86_64               3.10.0-1062.1.1.el7                 updates               8.7 M
     libmpc                       x86_64               1.0.1-3.el7                         base                   51 k
     libzip                       x86_64               0.10.1-8.el7                        base                   48 k
     mpfr                         x86_64               3.1.1-4.el7                         base                  203 k
     php-common                   x86_64               5.4.16-46.el7                       base                  565 k
    
    Transaction Summary
    ===================================================================================================================
    Install  2 Packages (+8 Dependent packages)
    
    Total download size: 36 M
    Installed size: 73 M
    Downloading packages:
    (1/10): cpp-4.8.5-39.el7.x86_64.rpm                                                         | 5.9 MB  00:00:00     
    (2/10): glibc-devel-2.17-292.el7.x86_64.rpm                                                 | 1.1 MB  00:00:00     
    (3/10): glibc-headers-2.17-292.el7.x86_64.rpm                                               | 687 kB  00:00:00     
    (4/10): libmpc-1.0.1-3.el7.x86_64.rpm                                                       |  51 kB  00:00:00     
    (5/10): gcc-4.8.5-39.el7.x86_64.rpm                                                         |  16 MB  00:00:01     
    (6/10): libzip-0.10.1-8.el7.x86_64.rpm                                                      |  48 kB  00:00:00     
    (7/10): mpfr-3.1.1-4.el7.x86_64.rpm                                                         | 203 kB  00:00:00     
    (8/10): php-common-5.4.16-46.el7.x86_64.rpm                                                 | 565 kB  00:00:00     
    (9/10): php-cli-5.4.16-46.el7.x86_64.rpm                                                    | 2.7 MB  00:00:00     
    (10/10): kernel-headers-3.10.0-1062.1.1.el7.x86_64.rpm                                      | 8.7 MB  00:00:00     
    -------------------------------------------------------------------------------------------------------------------
    Total                                                                               20 MB/s |  36 MB  00:00:01     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : mpfr-3.1.1-4.el7.x86_64                                                                        1/10 
      Installing : libmpc-1.0.1-3.el7.x86_64                                                                      2/10 
      Installing : cpp-4.8.5-39.el7.x86_64                                                                        3/10 
      Installing : kernel-headers-3.10.0-1062.1.1.el7.x86_64                                                      4/10 
      Installing : glibc-headers-2.17-292.el7.x86_64                                                              5/10 
      Installing : glibc-devel-2.17-292.el7.x86_64                                                                6/10 
      Installing : libzip-0.10.1-8.el7.x86_64                                                                     7/10 
      Installing : php-common-5.4.16-46.el7.x86_64                                                                8/10 
      Installing : php-cli-5.4.16-46.el7.x86_64                                                                   9/10 
      Installing : gcc-4.8.5-39.el7.x86_64                                                                       10/10 
      Verifying  : glibc-devel-2.17-292.el7.x86_64                                                                1/10 
      Verifying  : mpfr-3.1.1-4.el7.x86_64                                                                        2/10 
      Verifying  : php-cli-5.4.16-46.el7.x86_64                                                                   3/10 
      Verifying  : libzip-0.10.1-8.el7.x86_64                                                                     4/10 
      Verifying  : libmpc-1.0.1-3.el7.x86_64                                                                      5/10 
      Verifying  : cpp-4.8.5-39.el7.x86_64                                                                        6/10 
      Verifying  : gcc-4.8.5-39.el7.x86_64                                                                        7/10 
      Verifying  : kernel-headers-3.10.0-1062.1.1.el7.x86_64                                                      8/10 
      Verifying  : glibc-headers-2.17-292.el7.x86_64                                                              9/10 
      Verifying  : php-common-5.4.16-46.el7.x86_64                                                               10/10 
    
    Installed:
      gcc.x86_64 0:4.8.5-39.el7                             php-cli.x86_64 0:5.4.16-46.el7                            
    
    Dependency Installed:
      cpp.x86_64 0:4.8.5-39.el7                            glibc-devel.x86_64 0:2.17-292.el7                           
      glibc-headers.x86_64 0:2.17-292.el7                  kernel-headers.x86_64 0:3.10.0-1062.1.1.el7                 
      libmpc.x86_64 0:1.0.1-3.el7                          libzip.x86_64 0:0.10.1-8.el7                                
      mpfr.x86_64 0:3.1.1-4.el7                            php-common.x86_64 0:5.4.16-46.el7                           
    
    Complete!
    [[email protected] ~]# cd ~
    [[email protected] ~]# wget https://s3.amazonaws.com/cloudbench/software/UnixBench5.1.3.tgz
    
    --2019-10-01 01:20:30--  https://s3.amazonaws.com/cloudbench/software/UnixBench5.1.3.tgz
    Resolving s3.amazonaws.com (s3.amazonaws.com)... 52.217.38.246
    Connecting to s3.amazonaws.com (s3.amazonaws.com)|52.217.38.246|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 143259 (140K) [application/x-compressed]
    Saving to: ‘UnixBench5.1.3.tgz’
    
    100%[=========================================================================>] 143,259     --.-K/s   in 0.09s   
    
    2019-10-01 01:20:31 (1.45 MB/s) - ‘UnixBench5.1.3.tgz’ saved [143259/143259]
    
    [[email protected] ~]# tar zxf UnixBench5.1.3.tgz
    [[email protected] ~]# cd UnixBench
    [[email protected] UnixBench]# make all
    Checking distribution of files
    ./pgms  exists
    ./src  exists
    ./testdir  exists
    ./results  exists
    gcc -o ./pgms/arithoh -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Darithoh ./src/arith.c
    gcc -o ./pgms/register -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum='register int' ./src/arith.c
    gcc -o ./pgms/short -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=short ./src/arith.c
    gcc -o ./pgms/int -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=int ./src/arith.c
    gcc -o ./pgms/long -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=long ./src/arith.c
    gcc -o ./pgms/float -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=float ./src/arith.c
    gcc -o ./pgms/double -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -Ddatum=double ./src/arith.c
    gcc -o ./pgms/hanoi -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/hanoi.c
    gcc -o ./pgms/syscall -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/syscall.c
    ./src/syscall.c: In function ‘main’:
    ./src/syscall.c:93:21: warning: null argument where non-null required (argument 2) [-Wnonnull]
                         execl("/bin/true", (char *) 0);
                         ^
    gcc -o ./pgms/context1 -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/context1.c
    gcc -o ./pgms/pipe -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/pipe.c
    gcc -o ./pgms/spawn -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/spawn.c
    gcc -o ./pgms/execl -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/execl.c
    In file included from ./src/execl.c:34:0:
    ./src/big.c: In function ‘getwork’:
    ./src/big.c:452:11: warning: variable ‘c’ set but not used [-Wunused-but-set-variable]
         char  c;
               ^
    cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c
    cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c
    gcc -o ./pgms/dhry2 -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/dhry_1.o ./src/dhry_2.o
    cd ./src; rm -f dhry_1.o dhry_2.o
    cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c -o dhry_1_reg.o
    cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c -o dhry_2_reg.o
    gcc -o ./pgms/dhry2reg -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/dhry_1_reg.o ./src/dhry_2_reg.o
    cd ./src; rm -f dhry_1_reg.o dhry_2_reg.o
    gcc -o ./pgms/looper -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/looper.c
    gcc -o ./pgms/fstime -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/fstime.c
    gcc -o ./pgms/whetstone-double -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -DDP -DUNIX -DUNIXBENCH ./src/whets.c -lm
    
    [[email protected] UnixBench]# ls
    Makefile  pgms  README  results  Run  src  testdir  tmp  USAGE  WRITING_TESTS
    [[email protected] UnixBench]# ./Run
    make all
    make[1]: Entering directory `/root/UnixBench'
    Checking distribution of files
    ./pgms  exists
    ./src  exists
    ./testdir  exists
    ./tmp  exists
    ./results  exists
    make[1]: Leaving directory `/root/UnixBench'
    sh: 3dinfo: command not found
    
       #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
       #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
       #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
       #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
       #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
        ####   #    #  #  #    #          #####   ######  #    #   ####   #    #
    
       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
    
    


    Following test result is coming from GCP Free Tier VM:
    [[email protected] UnixBench]# ./Run
    make all
    make[1]: Entering directory `/root/UnixBench'
    Checking distribution of files
    ./pgms  exists
    ./src  exists
    ./testdir  exists
    ./tmp  exists
    ./results  exists
    make[1]: Leaving directory `/root/UnixBench'
    sh: 3dinfo: command not found
    
       #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
       #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
       #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
       #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
       #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
        ####   #    #  #  #    #          #####   ######  #    #   ####   #    #
    
       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
    
    ========================================================================
       BYTE UNIX Benchmarks (Version 5.1.3)
    
       System: instance-1test: GNU/Linux
       OS: GNU/Linux -- 3.10.0-957.27.2.el7.x86_64 -- #1 SMP Mon Jul 29 17:46:05 UTC 2019
       Machine: x86_64 (x86_64)
       Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
       CPU 0: Intel(R) Xeon(R) CPU @ 2.30GHz (4600.0 bogomips)
              Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
       01:26:04 up 25 min,  1 user,  load average: 0.04, 0.20, 0.34; runlevel 3
    
    ------------------------------------------------------------------------
    Benchmark Run: Tue Oct 01 2019 01:26:04 - 01:59:30
    1 CPU in system; running 1 parallel copy of tests
    
    Dhrystone 2 using register variables       25305481.5 lps   (10.0 s, 7 samples)
    Double-Precision Whetstone                      900.5 MWIPS (43.0 s, 7 samples)
    Execl Throughput                                758.4 lps   (29.6 s, 2 samples)
    File Copy 1024 bufsize 2000 maxblocks        309034.2 KBps  (30.0 s, 2 samples)
    File Copy 256 bufsize 500 maxblocks           42617.1 KBps  (30.1 s, 2 samples)
    File Copy 4096 bufsize 8000 maxblocks        607069.7 KBps  (30.0 s, 2 samples)
    Pipe Throughput                              295781.1 lps   (10.1 s, 7 samples)
    Pipe-based Context Switching                  65693.7 lps   (10.0 s, 7 samples)
    Process Creation                               2960.3 lps   (30.1 s, 2 samples)
    Shell Scripts (1 concurrent)                   1036.0 lpm   (60.0 s, 2 samples)
    Shell Scripts (8 concurrent)                    121.2 lpm   (60.1 s, 2 samples)
    System Call Overhead                         258104.6 lps   (10.0 s, 7 samples)
    
    System Benchmarks Index Values               BASELINE       RESULT    INDEX
    Dhrystone 2 using register variables         116700.0   25305481.5   2168.4
    Double-Precision Whetstone                       55.0        900.5    163.7
    Execl Throughput                                 43.0        758.4    176.4
    File Copy 1024 bufsize 2000 maxblocks          3960.0     309034.2    780.4
    File Copy 256 bufsize 500 maxblocks            1655.0      42617.1    257.5
    File Copy 4096 bufsize 8000 maxblocks          5800.0     607069.7   1046.7
    Pipe Throughput                               12440.0     295781.1    237.8
    Pipe-based Context Switching                   4000.0      65693.7    164.2
    Process Creation                                126.0       2960.3    234.9
    Shell Scripts (1 concurrent)                     42.4       1036.0    244.3
    Shell Scripts (8 concurrent)                      6.0        121.2    202.1
    System Call Overhead                          15000.0     258104.6    172.1
                                                                       ========
    System Benchmarks Index Score                                         316.9
    
    [[email protected] UnixBench]# 

    Bench.sh - from 秋水逸冰

     bench.sh 特点:

    1、显示当前测试的各种系统信息;
    2、取自世界多处的知名数据中心的测试点,下载测试比较全面;
    3、支持 IPv6 下载测速;
    4、IO 测试三次,并显示平均值。
    使用方法:
    命令1:
    wget -qO- bench.sh | bash
    或者
    curl -Lso- bench.sh | bash
    命令2:
    wget -qO- 86.re/bench.sh | bash
    或者
    curl -so- 86.re/bench.sh | bash
    备注:
    bench.sh 既是脚本名,同时又是域名。所以不要怀疑我写错了或者你看错了。

    nench.sh (new bench.sh) script:


    https://github.com/n-st/nench provides a nice bench.sh and a single command for you to run this script on your VPS.


    Commands to run this script:

    (curl -s wget.racing/nench.sh | bash; curl -s wget.racing/nench.sh | bash) 2>&1 | tee nench.log
    
    (wget -qO- wget.racing/nench.sh | bash; wget -qO- wget.racing/nench.sh | bash) 2>&1 | tee nench.log


    Basically this benchmark script will do following tasks:
    • get system info
    • benchmark the processor and memory (both single and multi core)
    • benchmark the disk
    • benchmark networking

    SuperBench.sh - 一键测试服务器 

    from 老鬼的博客 (Oldking)

    一、特点

    1. 改进了显示的模式,基本参数添加了颜色,方面区分与查找。
    2. I/O测试,更改了原来默认的测试的内容,采用小文件,中等文件,大文件,分别测试IO性能,然后取平均值。
    3. 速度测试替换成了 Superspeed 里面的测试,第一个默认节点是,Speedtest 默认,其他分别测试到中国电信,联通,移动,各三个不同地区的速度。

    二、使用方法

    wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
    或者
    curl -Lso- -no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash

    wget -qO- git.io/superbench.sh | bash

    curl -LsO git.io/superbench.sh; chmod +x superbench.sh




    Zbench 测试脚本 from 漏水和kirito

    脚本由漏水和kirito,基于Oldking大佬 的 SuperBench,然后加入Ping以及路由测试的功能,还能生成测评报告,分享给其他人查看测评数据

    使用方法

    #中文版
    wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench-CN.sh && bash ZBench-CN.sh

    #英文版
    wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench.sh && bash ZBench.sh


    VPS Nework Speed Test

    wget https://raw.githubusercontent.com/oooldking/script/master/superspeed.sh && chmod +x superspeed.sh && ./superspeed.sh





    References:





    No comments:

    Post a Comment