一键测试脚本bench.sh

技术 秋水逸冰 391374浏览 99评论

经过几个版本的迭代,一键测试脚本 bench.sh 已经几乎适用于各个 Linux 发行版的网络和 IO 测试。
并将测试结果以较为美观的方式显示出来。

总结一下 bench.sh 的特点:

1、显示各种系统信息;
2、取自 Speedtest 世界多处的数据中心的测试点,网络测试比较全面;
3、支持 IPv6 下载测速;
4、IO 测试(顺序写入 1GB 数据)三次,并显示其平均值。

再配合 unixbench.sh 脚本测试,即可全面测试 VPS 的性能。

使用方法:
命令:

wget -qO- bench.sh | bash

或者

curl -Lso- bench.sh | bash

备注:
bench.sh 既是脚本名,同时又是域名。所以不要怀疑我写错了或者你看错了。

下载地址:
https://github.com/teddysun/across/blob/master/bench.sh

更新日志

2023 年 10 月 15 日更新:
1. 升级 speedtest-cli 的版本到 1.2.0;
2. 使用 shfmt 格式(美)化 bash script;
3. 新增 ✓ 和 ✗ 的 Emoji 颜文字(絵文字);
4. 修正 CPU 型号中包含字符串 processor 导致的内核数量计算错误,比如有的虚拟机会把 CPU 名称显示为 Common KVM processor;

2023 年 06 月 10 日更新:
1. 新增是否支持 IPv4 和 IPv6 的判断并显示出 Online 或 Offline;

2022 年 02 月 22 日更新:
1. 新增 CPU 是否支持 AES-NI 和 VM-x/AMD-V 的判断;
2. 改进了计算硬盘空间的算法;
3. 改进了计算 RAM 和 Swap 的算法;
4. 改善时间戳显示方式,加入时区显示;

2022 年 01 月 01 日更新:
1. 优化脚本逻辑,美化显示方式;
2. 升级 speedtest-cli 的版本到 1.1.1;
3. 支持 arm64 (aarch64) 以及 armv7l (armhf) 架构,如下图;
・arm64 (aarch64)

・armv7l (armhf)

4. 优化 Speedtest 提供的测速服务器列表。
・x86_64

2020 年 07 月 29 日更新:
1. 修改:测速为 Speedtest 提供的,区分上传下载,更实用;
2. 增加:TCP Congestion Control;虚拟化方式;IP 信息等。

下图所示的是我的 Vultr 的评测数据:

2018 年 01 月 07 日更新:
修改:显示信息的颜色,分门别类,更容易区分。

下图所示的是我的 Kimsufi KS3C 百兆独服的评测数据:

转载请注明:秋水逸冰 » 一键测试脚本bench.sh

发表我的评论
取消评论

请输入正确答案后提交评论 *超出时限。 请再次填写验证码。

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (99)

  1. 使用haproxy中转Shadowsocks流量一键安装脚本,在使用https://shadowsocks.be/10.html教程安装时,出现teddysun.com域名无法解析,该怎么办
    vguhang8年前(2016-10-12)回复
    • VPS 的 Nameserver 换成 Google 的 8.8.8.8 后再试。
      秋水逸冰8年前(2016-10-13)回复
  2. 在腾讯云上不能测试
    hiugiu8年前(2016-10-05)回复
    • 我一时冲动也是在腾讯云上用了这个脚本测试,我用的是腾讯云学生机,结果几个小时还没测完
      Jianrry7年前(2016-11-20)回复
      • 这个测试脚本,下载的都是从国外的数据中心测速的。你在国内的 VPS 跑,当然慢死
        秋水逸冰7年前(2016-11-21)回复
  3. 我的vps明明是100M带宽。可是为什么Download Speed最高有62.0MB/s 100M带宽还要除以8,大概我最高的速度应该只有12M多 你应该知道1byte=8bits 请问download speak显示的MB数值到底是什么单位?
    昵称8年前(2016-09-28)回复
  4. 请问跑分显示16MB/s速度,是不是指16÷8=2MB
    昵称8年前(2016-09-28)回复
  5. 请教下测试图片中不同信息不同颜色这个是肿么实现的?
    MACMIS8年前(2016-07-16)回复
    • 你去看代码喽。怎么实现的写的很清楚。
      秋水逸冰8年前(2016-07-16)回复
  6. 谢谢,希望download speed也能计算一下平均值显示出来
    [email protected]8年前(2016-06-20)回复
  7. 00MB-singapore.bin 这些下载的测试文件会自动删除吗?
    78788年前(2016-06-06)回复
    • 会。
      秋水逸冰8年前(2016-06-06)回复
      • 能不能加个上传速度的测试啊大神
        78788年前(2016-06-07)回复
        • 上传测试,需要将此 vps 开启 http 服务,并在其他 vps 下载此 vps 的测试文件,从而达到测速的目的。 不能不想,是不能也。
          秋水逸冰8年前(2016-06-08)回复
          • 好吧,想想HTTP就麻烦了
            78788年前(2016-06-08)回复
  8. 请问具体的要看什么指标,下载的速度越快越好吗? 比如我的VPS想做VPN用,那这个下行速度的指标有没有参考价值?还是需要看另外指标?谢谢!
    J.Sun8年前(2016-05-29)回复
  9. 要是增加中国内地的测试就好了
    就是爱玩8年前(2016-05-10)回复
  10. 太好用了,这个脚本,让我等小白用起来很爽
    5美元VPS推荐8年前(2016-04-15)回复
  11. # # # # # # # ##### ###### # # #### # # # # ## # # # # # # # ## # # # # # # # # # # # ## ##### ##### # # # # ###### # # # # # # ## # # # # # # # # # # # # ## # # # # # # # ## # # # # #### # # # # # ##### ###### # # #### # # Version 5.1.2 Based on the Byte Magazine Unix Benchmark Multi-CPU version Version 5 revisions by Ian Smith, Sunnyvale, CA, USA December 22, 2007 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.2) System: wkzwxs: GNU/Linux OS: GNU/Linux -- 2.6.32-042stab113.11 -- #1 SMP Fri Dec 18 17:32:04 MSK 2015 Machine: x86_64 (x86_64) Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8") CPU 0: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz (5200.4 bogomips) Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization 22:35:37 up 32 min, 1 user, load average: 0.00, 0.04, 0.02; runlevel 3 ------------------------------------------------------------------------ Benchmark Run: Mon Mar 28 2016 22:35:37 - 23:04:14 1 CPU in system; running 1 parallel copy of tests Dhrystone 2 using register variables 32381138.1 lps (10.0 s, 7 samples) Double-Precision Whetstone 3515.3 MWIPS (9.9 s, 7 samples) Execl Throughput 4222.3 lps (29.7 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks 544094.4 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 142564.1 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 1382706.1 KBps (30.0 s, 2 samples) Pipe Throughput 1166156.8 lps (10.0 s, 7 samples) Pipe-based Context Switching 230097.6 lps (10.0 s, 7 samples) Process Creation 10467.9 lps (30.0 s, 2 samples) Shell Scripts (1 concurrent) 4844.1 lpm (60.0 s, 2 samples) Shell Scripts (8 concurrent) 647.8 lpm (60.1 s, 2 samples) System Call Overhead 1885689.4 lps (10.0 s, 7 samples) System Benchmarks Index Values BASELINE RESULT INDEX Dhrystone 2 using register variables 116700.0 32381138.1 2774.7 Double-Precision Whetstone 55.0 3515.3 639.1 Execl Throughput 43.0 4222.3 981.9 File Copy 1024 bufsize 2000 maxblocks 3960.0 544094.4 1374.0 File Copy 256 bufsize 500 maxblocks 1655.0 142564.1 861.4 File Copy 4096 bufsize 8000 maxblocks 5800.0 1382706.1 2384.0 Pipe Throughput 12440.0 1166156.8 937.4 Pipe-based Context Switching 4000.0 230097.6 575.2 Process Creation 126.0 10467.9 830.8 Shell Scripts (1 concurrent) 42.4 4844.1 1142.5 Shell Scripts (8 concurrent) 6.0 647.8 1079.6 System Call Overhead 15000.0 1885689.4 1257.1 ======== System Benchmarks Index Score 1107.7 博主看看这个怎么样
    jack8年前(2016-03-29)回复
  12. 好吧,被国人玩坏了。 对了,站长,这速度怎样? ________ ______ ______ __ _ / _/ __ \/ ____/ / ____/________ ____ / /_(_)__ _____ / // / / / / / /_ / ___/ __ \/ __ \/ __/ / _ \/ ___/ _/ // /_/ / /___ / __/ / / / /_/ / / / / /_/ / __/ / /___/_____/\____/ /_/ /_/ \____/_/ /_/\__/_/\___/_/ [root@TheMoon ~]# curl -so- 86.re/bench.sh | bash ---------------------------------------------------------------------- CPU model : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz Number of cores : 1 CPU frequency : 2799.999 MHz Total amount of ram : 986 MB Total amount of swap : 0 MB System uptime : 1days, 23:52:43 OS : CentOS Linux 7 Arch : x86_64 (64 Bit) Kernel : 3.10.0-229.1.2.el7.x86_64 ---------------------------------------------------------------------- Node Name IPv4 address Download Speed CacheFly 204.93.150.152 98.0MB/s Linode, Tokyo, JP 106.187.96.148 188MB/s Linode, Singapore, SG 139.162.23.4 28.0MB/s Linode, London, UK 176.58.107.39 7.53MB/s Linode, Frankfurt, DE 139.162.130.8 6.90MB/s Linode, Fremont, CA 50.116.14.9 19.2MB/s Softlayer, Dallas, TX 173.192.68.18 18.7MB/s Softlayer, Seattle, WA 67.228.112.250 27.7MB/s Softlayer, Frankfurt, DE 159.122.69.4 5.63MB/s Softlayer, Singapore, SG 119.81.28.170 29.5MB/s Softlayer, HongKong, CN 119.81.130.170 38.6MB/s ---------------------------------------------------------------------- I/O speed(1st run) : 451 MB/s I/O speed(2nd run) : 190 MB/s I/O speed(3rd run) : 187 MB/s Average I/O: 276 MB/s
    无私的玉兔8年前(2016-03-25)回复
  13. vultr 美国纽约机房 root@vultr ~]# wget -qO- bench.sh | bash ---------------------------------------------------------------------- CPU model : Virtual CPU e7da7129d3ee Number of cores : 1 CPU frequency : 2399.998 MHz Total amount of ram : 742 MB Total amount of swap : 0 MB System uptime : 0days, 13:43:32 OS : CentOS 6.7 Arch : x86_64 (64 Bit) Kernel : 2.6.32-573.8.1.el6.x86_64 ---------------------------------------------------------------------- Node Name IPv4 address Download Speed CacheFly 205.234.175.175 169MB/s Linode, Tokyo, JP 106.187.96.148 4.04MB/s Linode, Singapore, SG 139.162.23.4 6.82MB/s Linode, London, UK 176.58.107.39 19.6MB/s Linode, Frankfurt, DE 139.162.130.8 12.7MB/s Linode, Fremont, CA 50.116.14.9 23.1MB/s Softlayer, Dallas, TX 173.192.68.18 31.4MB/s Softlayer, Seattle, WA 67.228.112.250 22.6MB/s Softlayer, Frankfurt, DE 159.122.69.4 14.1MB/s Softlayer, Singapore, SG 119.81.28.170 6.69MB/s Softlayer, HongKong, CN 119.81.130.170 6.48MB/s ---------------------------------------------------------------------- Node Name IPv6 address Download Speed Linode, Atlanta, GA 2600:3c02::4b 73.3MB/s Linode, Dallas, TX 2600:3c00::4b 35.6MB/s Linode, Newark, NJ 2600:3c03::4b 93.8MB/s Linode, Singapore, SG 2400:8901::4b 1.13MB/s Linode, Tokyo, JP 2400:8900::4b 9.38MB/s Softlayer, San Jose, CA 2607:f0d0:2601:2a::4 18.5MB/s Softlayer, Washington, WA 2607:f0d0:3001:78::2 6.26MB/s Softlayer, Paris, FR 2a03:8180:1301:8::4 13.4MB/s Softlayer, Singapore, SG 2401:c900:1101:8::2 5.99MB/s Softlayer, Tokyo, JP 2401:c900:1001:16::4 7.72MB/s ---------------------------------------------------------------------- I/O speed(1st run) : 422 MB/s I/O speed(2nd run) : 457 MB/s I/O speed(3rd run) : 456 MB/s Average I/O: 445 MB/s 国外vps就是快
    crysisxc8年前(2016-02-24)回复
  14. 新年快乐哟~
    Zohar8年前(2016-02-08)回复
    • ---------------------------------------------------------------------- CPU model : QEMU Virtual CPU version (cpu64-rhel6) Number of cores : 1 CPU frequency : 3192.746 MHz Total size of Disk : 29.0 GB (23.0 GB Used) Total amount of Mem : 996 MB (684 MB Used) Total amount of Swap : 1023 MB (4 MB Used) System uptime : 39 days, 2 hour 39 min Load average : 0.03, 0.13, 0.09 OS : CentOS 6.8 Arch : x86_64 (64 Bit) Kernel : 2.6.32-642.11.1.el6.x86_64 ---------------------------------------------------------------------- I/O speed(1st run) : 321 MB/s I/O speed(2nd run) : 319 MB/s I/O speed(3rd run) : 348 MB/s Average I/O speed : 329.3 MB/s ---------------------------------------------------------------------- Node Name IPv4 address Download Speed CacheFly 205.234.175.175 28.3MB/s Linode, Tokyo, JP 106.187.96.148 10.2MB/s Linode, Singapore, SG 139.162.23.4 17.0MB/s Linode, London, UK 176.58.107.39 4.91MB/s Linode, Frankfurt, DE 139.162.130.8 7.05MB/s Linode, Fremont, CA 50.116.14.9 8.90MB/s Softlayer, Dallas, TX 173.192.68.18 11.4MB/s Softlayer, Seattle, WA 67.228.112.250 15.4MB/s Softlayer, Frankfurt, DE 159.122.69.4 7.06MB/s Softlayer, Singapore, SG 119.81.28.170 38.6MB/s Softlayer, HongKong, CN 119.81.130.170 51.5MB/s ---------------------------------------------------------------------- Node Name IPv6 address Download Speed Linode, Atlanta, GA 2600:3c02::4b 3.68MB/s Linode, Dallas, TX 2600:3c00::4b 1.86MB/s Linode, Newark, NJ 2600:3c03::4b 5.91MB/s Linode, Singapore, SG 2400:8901::4b 33.0MB/s Linode, Tokyo, JP 2400:8900::4b 11.9MB/s Softlayer, San Jose, CA 2607:f0d0:2601:2a::4 3.25MB/s Softlayer, Washington, WA 2607:f0d0:3001:78::2 2.06MB/s Softlayer, Paris, FR 2a03:8180:1301:8::4 10.1MB/s Softlayer, Singapore, SG 2401:c900:1101:8::2 26.9MB/s Softlayer, Tokyo, JP 2401:c900:1001:16::4 13.5MB/s ---------------------------------------------------------------------- 來自LeaseWeb HK,採用He.net v4tov6 新加坡節點。
      萬能的玉兔7年前(2017-02-04)回复
  15. 不知道我的博客的速度怎么样,找时间测试一下。
    smartsun8年前(2016-01-31)回复