剪藏#IT家园#剪藏

服务器(vps)性能测试脚本汇总

2025 年 8 月 1 日1 分钟
分享Twitter / XTelegram微博
服务器(vps)性能测试脚本汇总 封面

前言

我们选购vps的后,最好对vps做一下测试。记录一下网络上各种vps测试脚本的使用方法和结果展示。

性能测试

bench.sh

测试VPS基础信息,以及下载速度,来自秋水逸冰

JAVASCRIPT
wget -qO- bench.sh | bash

Notion image

superbench.sh

可以看作 Bench.sh 的加强版,

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

Notion image

yabs.sh

YABS - 一个使用 fio、iperf3 和 Geekbench 估计 Linux 服务器性能的简单 bash 脚本

JAVASCRIPT
curl -sL yabs.sh | bash

Notion image

unixbench.sh

UnixBench是一个类unix系(Unix,BSD,Linux)统下的性能测试工具,一个开源工具,被广泛用于测试Linux系统主机的性能。Unixbench的主要测试项目有:系统调用、读写、进程、图形化测试、2D、3D、管道、运算、C库等系统基准性能提供测试数据。

JAVASCRIPT
wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh && sh unixbench.sh

Notion image

sysbench

sysbench是一个多线程的Linux测试工具,可以进行CPU性能测试。对CPU的测试,主要是进行素数的加法运行。

JAVASCRIPT
# 安装
curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | bash
yum -y install sysbench

# 测试fileio,进入要测试的硬盘目录
sysbench fileio --file-num=1 --file-total-size=1G --file-test-mode=rndrw --time=300 prepare
sysbench fileio --file-num=1 --file-total-size=1G --file-test-mode=rndrw --time=300 run
sysbench fileio --file-num=1 --file-total-size=1G --file-test-mode=rndrw --time=300 cleanup

# 测试 cpu
sysbench cpu --cpu-max-prime=3 run

# 测试memory
sysbench memory --memory-total-size=2G run

# 测试threads
sysbench threads --thread-yields=2 --thread-locks=4 run

Notion image

网络测试

Superspeed

脚本基于Speedtest,自动测试国内各节点的下载&I/O速度,网络上的脚本失效了。是因为spuertest版本更新,导致Speedtest安装失败导致的。去官方下载最新版本,然后更新版本号即可。 Speedtest官网

JAVASCRIPT
wget https://raw.githubusercontent.com/ernisn/superspeed/master/superspeed.sh
chmod +x superspeed.sh && ./superspeed.sh

没有结果,需要修改脚本

JAVASCRIPT
# 77行
wget --no-check-certificate -qO speedtest.tgz  https://install.speedtest.net/app/cli/ookla-speedtest-1.1.1-linux-$(uname -m).tgz > /dev/null 2>&1

Notion image

TCP回程路由测试

测试服务器TCP回程是否为CN2或联通移动直连线路。

JAVASCRIPT
curl http://tutu.ovh/bash/returnroute/test.sh|bash

Notion image

Besttrace4Linux路由测试脚本

Linux下带地理位置的路由跟踪工具besttrace4linux

JAVASCRIPT
#下载
wget http://cdn.ipip.net/17mon/besttrace4linux.zip
#解压
unzip besttrace4linux.zip
#授权
chmod +x besttrace
#使用
./besttrace -q 1  114.114.114.114

Notion image

其他测试

超内存测试

测试vps实际可用内存

JAVASCRIPT
#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

Notion image

综合测试

vpstest

常用的vps测试脚本集合

JAVASCRIPT
wget git.io/vpstest && bash vpstest

Notion image

GeekBench5

geekbench 5是一款可支持多种系统操作环境的系统测试工具,内置一整套基准测试,旨在快速准确地测量出CPU和GPU Compute的性能 可以生成html报告

JAVASCRIPT
wget git.io/vpstest && bash vpstest  #选择9

Notion image

ZBench

ZBench.sh 是一个一键检测服务器基本性能的脚本,基础代码来自 SpeedTest 和 OldKing 的 SuperSpeed。平时测试 VPS 的时候一直是靠着 Bench.sh 来测试。 可以生成html报告 项目地址 作者好久没有更新了,脚本调用的地址,api早已失效。可以自己改造,或参考学习一下。

JAVASCRIPT
# 中文版
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

执行脚本有报错需要修改

编辑 ZBench.sh

JAVASCRIPT
#注释行
#speed_test 'http://speedtest.tokyo.linode.com/100MB-tokyo.bin' 'Linode, Tokyo, JP'
#speed_test 'http://speedtest.sea01.softlayer.com/downloads/test100.zip' 'Softlayer, Seattle, WA'
#wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZPing-CN.py > /dev/null 2>&1'
#wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/Generate.py >> /dev/null 2>&1
#api.zbench.kirito.moe 域名也已经失效

手动下载 ZPing-CN.py

JAVASCRIPT
cd /tmp/
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZPing-CN.py > /dev/null 2>&1

## 打开脚本,注释内容,或更新为有效的节点IP
#'合肥': '112.122.10.26',
#'武汉': '113.57.249.2',
#'北京': 'st1.bjtelecom.net',
#'成都': 'speed.westidc.com.cn',

手动下载 Generate.py

JAVASCRIPT
import time
#traceroute_to_dict函数添加
#19行
time.sleep(1)

Notion image

91yuntest

一键包主要是为了让大家快速对服务器的基本状况有一个了解。这个一键包更加偏向网络的测试。 可以生成html报告 项目官网

JAVASCRIPT
## 未进行ping测试和unixbench跑分
wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test.sh && bash test.sh -i "io,bandwidth,chinabw,download,backtraceroute"

## 完整测试版,耗时较长
wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test.sh && bash test.sh -i "io,bandwidth,chinabw,download,backtraceroute,gotoping,benchtest"

Notion image

LemonBenchIntl

利用LemonBench测试vps综合性能,主要特点是可以一键测试服务器系统信息、网络IP信息、虚拟服务器大带宽情况以及CPU、内存、硬盘的性能

JAVASCRIPT
curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast

Notion image

原文地址: https://mp.weixin.qq.com/s?__biz=MzkyNjE5NjQ2NA==&mid=2247485078&idx=1&sn=271a87dc5373e16fc10437e1a38bedbe&chksm=c3240a0e08fa7a1fafbf98f19532887621f6016813889371100b0ce97f464a5cc975f6d540f1&mpshare=1&scene=1&srcid=0801jYRbIRmOHiAvLaks6vR8&sharer_shareinfo=5b4b9dde4e3a4d79a3402386825a5610&sharer_shareinfo_first=5b4b9dde4e3a4d79a3402386825a5610#rd

相关文章