关于linux运维:服务器测试脚本集合

5次阅读

共计 4172 个字符,预计需要花费 11 分钟才能阅读完成。

局部脚本来自 Mr.KevinH

综合测试

原始版本 Bench

wget freevps.us/downloads/bench.sh -O - -o /dev/null|bash

秋水逸冰的 Bench.sh 脚本

特点:

  • 显示以后测试的各种零碎信息
  • 取自世界多处的出名数据中心的测试点,下载测试比拟全面
  • 反对 IPv6 下载测速;
  • IO 测试三次,并显示平均值。

应用:

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

老鬼的 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

91yuntest

在线脚本生成地址

https://www.91yuntest.com/

一般模式

wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test_91yun.sh && bash test_91yun.sh

一般模式就是之前的测试惯例内容。测试输入后果请参考:一般模式后果款式参考

简略模式

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

齐全模式

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

Linux-Server-Bench-Test

wget https://raw.githubusercontent.com/chiakge/Linux-Server-Bench-Test/master/linuxtest.sh -N --no-check-certificate

运行阐明

不含 UnixBench 的测试,无网页分享

bash linuxtest.sh

不含 UnixBench 的测试,带网页分享

bash linuxtest.sh s

含 UnixBench 的测试,不带网页分享

bash linuxtest.sh a

含 UnixBench 的测试,带网页分享

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

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

路由测试脚本

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

wget https://raw.githubusercontent.com/helloxz/mping/master/mping.sh
bash mping.sh
正文完
 0