--- title: 服务器测试脚本集合 english_title: top: 0 date: 2019-08-30 15:56:37 categories: tags: - 服务器 - 测试 fancybox: comments: true permalink: description: --- > 部分脚本来自[Mr.KevinH](https://www.mrkevin.net/share/1383.html) ## 综合测试 ### 原始版本Bench ```bash wget freevps.us/downloads/bench.sh -O - -o /dev/null|bash ``` ### 秋水逸冰的Bench.sh脚本 #### 特点: - 显示当前测试的各种系统信息 - 取自世界多处的知名数据中心的测试点,下载测试比较全面 - 支持 IPv6 下载测速; - IO 测试三次,并显示平均值。 #### 使用: ```bash wget -qO- bench.sh | bash ``` 或者 ``` curl -Lso- bench.sh | bash ``` 或者 ``` wget -qO- 86.re/bench.sh | bash ``` 或者 ``` curl -so- 86.re/bench.sh | bash ``` #### Github地址 [https://github.com/teddysun/across/blob/master/bench.sh](https://github.com/teddysun/across/blob/master/bench.sh) ### 老鬼的SuperBench测试脚本 这个脚本是在基于秋水大佬脚本的基础上,加入了独服通电时间,服务器虚拟化架构等内容 #### 特点: 改进了显示的模式,基本参数添加了颜色,方面区分与查找。 I/O测试,更改了原来默认的测试的内容,采用小文件,中等文件,大文件,分别测试IO性能,然后取平均值。 速度测试替换成了 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 ``` Github [https://github.com/oooldking/script/blob/master/superbench.sh](https://github.com/oooldking/script/blob/master/superbench.sh) ### 91yuntest 在线脚本生成地址 [https://www.91yuntest.com/](https://www.91yuntest.com/) #### 普通模式 ```bash wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test_91yun.sh && bash test_91yun.sh ``` 普通模式就是之前的测试常规内容。测试输出结果请参考:普通模式结果样式参考 #### [](https://github.com/zhiiker/91yuntest#简单模式)简单模式 ```bash wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test_91yun.sh && bash test_91yun.sh s ``` 简单模式的测试包含:常规系统参数检测,带宽测试,IO测试和全国ping测试。测试输出结果请参考:简单模式结果样式参考 主要因为普通模式的下载测试和路由测试有些耗时,有时大家可能只需要快速获得这台服务器的参数,带宽,io和延迟是多少。那么简单模式可以节省大量的时间。如果需要进一步的信息则可以使用普通模式。 相比普通模式,就是在命令最后加个s参数: bash test_91yun.sh s #### [](https://github.com/zhiiker/91yuntest#完全模式)完全模式 ```bash wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test_91yun.sh && bash test_91yun.sh a ``` 完全模式相比普通模式多了unixbench的测试,测试输出结果请参考:完全模式结果样式参考 相比普通模式,就是在命令最后加个a参数: bash test_91yun.sh a 由于unixbench的测试极其耗资源(cpu和io会长时间处于占满状态),有些IDC禁用,会杀进程或者判断滥用。请谨慎测试。 另外unixbench的测试也极其耗时间,建议大家在screen下运行。 ### Zbench 脚本由漏水和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 ``` #### 演示地址 [https://www.zhujiboke.com/zbench-example.html](https://www.zhujiboke.com/zbench-example.html) ### Linux-Server-Bench-Test ```bash wget https://raw.githubusercontent.com/chiakge/Linux-Server-Bench-Test/master/linuxtest.sh -N --no-check-certificate ``` 运行说明 #### 不含UnixBench的测试,无网页分享 ```bash bash linuxtest.sh ``` #### 不含UnixBench的测试,带网页分享 ```bash bash linuxtest.sh s ``` #### 含UnixBench的测试,不带网页分享 ```bash bash linuxtest.sh a ``` #### 含UnixBench的测试,带网页分享 ```bash bash linuxtest.sh as ``` ## 服务器性能测试 ### LemonBench LemonBench工具(别名LBench、柠檬Bench),是一款针对Linux服务器设计的服务器性能测试工具。通过综合测试,可以快速评估服务器的综合性能,为使用者提供服务器硬件配置信息。 #### 使用方法 ``` curl -fsSL https://ilemonrain.com/download/shell/LemonBench.sh | bash ``` 或者 ``` wget -qO- https://ilemonrain.com/download/shell/LemonBench.sh | bash ``` ### UnixBench测试脚本 UnixBench是一个类unix系(Unix,BSD,Linux)统下的性能测试工具,一个开源工具,被广泛用与测试linux系统主机的性能。Unixbench的主要测试项目有:系统调用、读写、进程、图形化测试、2D、3D、管道、运算、C库等系统基准性能提供测试数据。 #### 使用方法 ``` wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh chmod +x unixbench.sh ./unixbench.sh ``` 带宽测试 ``` wget https://raw.github.com/sivel/speedtest-cli/master/speedtest.py chmod a+rx speedtest.py python speedtest.py ``` ### 内存检测脚本 检测VPS真实可分配内存的小工具,适用于检测VPS超售情况。本程序检测的可分配内存指的是用户使用时最大能占用的内存量。 #### 使用方法 #### CentOS / RHEL ``` yum install wget -y yum groupinstall "Development Tools" -y wget https://raw.githubusercontent.com/FunctionClub/Memtester/master/memtester.cpp gcc -l stdc++ memtester.cpp ./a.out ``` Ubuntu / Debian ``` apt-get update apt-get install wget build-essential -y wget https://raw.githubusercontent.com/FunctionClub/Memtester/master/memtester.cpp gcc -l stdc++ memtester.cpp ./a.out ``` ## 网络测试 ### Ping值测试 uPing——一个24小时监测VPS延迟的工具 #### 依赖安装 Debian / Ubuntu ``` apt-get update apt-get install python wget screen -y ``` CentOS / RHEL ``` yum install screen wget python -y ``` #### 使用方法 ``` screen -S uping wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/uPing/master/uping.py python uping.py ``` ### speedtest-cli ```bash wget https://raw.github.com/sivel/speedtest-cli/master/speedtest.py chmod a+rx speedtest.py sudo mv speedtest.py /usr/local/bin/speedtest-cli sudo chown root:root /usr/local/bin/speedtest-cli speedtest-cli ``` ### 路由测试脚本 ```bash wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh bash testrace.sh ``` ### 回程路由测试 从你的 Linux(X86/ARM)/Mac/BSD 系统环境下发起 traceroute 请求,附带链路可视化,兼容性更好,支持JSON 格式。 下载 ``` wget https://cdn.ipip.net/17mon/besttrace4linux.zip ``` 解压 ``` unzip besttrace4linux.zip ``` 使用 ``` ./besttrace -q 1 这里是目标IP ``` ### 回程ping ```bash wget https://raw.githubusercontent.com/helloxz/mping/master/mping.sh bash mping.sh ```