vps 初始配置与性能测试

2021-04-20
2分钟阅读时长

以腾讯云为例

  • root密码设置:

sudo passwd root

输入密码

  • 卸载监控

一、云镜&安全监控卸载

/usr/local/qcloud/stargate/admin/uninstall.sh
/usr/local/qcloud/YunJing/uninst.sh
/usr/local/qcloud/monitor/barad/admin/uninstall.sh

二、验证卸载

ps aux | grep -i agent | grep -v grep`
  • 测试

参考:https://zhuanlan.zhihu.com/p/117547388

Bench.sh

秋水逸冰大佬的写的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

演示

SuperBench.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/superb

演示

UnixBench.sh

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

特点

  • 自动安装UnixBench和测试脚本
  • 系统调用、读写、进程、图形化测试、2D、3D、管道、运算、C库等系统基准性能

使用

wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh
chmod +x unixbench.sh
./unixbench.sh

演示

LemonBench.sh

LemonBench工具(别名LBench、柠檬Bench),是一款针对Linux服务器设计的服务器性能测试工具。通过综合测试,可以快速评估服务器的综合性能,为使用者提供服务器硬件配置信息。

特点

  • 服务器基础信息(CPU信息/内存信息/Swap信息/磁盘空间信息等)
  • Speedtest网速测试 (本地到最近源及国内各地域不同线路的网速)
  • 磁盘测试(4K块/1M块 直接写入测试)
  • 路由追踪测试(追踪到国内和海外不同线路的路由信息)
  • Spoofer测试(获取详细网络信息,快速判断服务器接入线路)

使用

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

演示

内存检测脚本

FunctionClub大佬作品,本程序检测的可分配内存指的是用户使用时最大能占用的内存量。

特点

  • 检测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

演示

uPing

FunctionClub大佬作品,测试阶段,请勿用于生产环境!

特点

  • 一个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

演示

Besttrace4Linux

回程路由测试http://-IPIP.net出品

特点

  • Linux(X86/ARM)/Mac/BSD 系统环境下发起 traceroute 请求
  • 附带链路可视化
  • 兼容性强
  • 支持 JSON 格式

使用

wget http://cdn.ipip.net/17mon/besttrace4linux.zip
#解压
unzip besttrace4linux.zip
#授权
chmod +x besttrace
#使用
./besttrace -q 1 这里是目标IP

如果是64位系统则直接besttrace替换besttrace32

演示

Speedtest-Cli

国外大佬Sivel作品

特点

  • 测试网络上传/下载速率的一款工具
  • Python2.4至3.4版本下均可运行

使用

#下载
wget https://raw.github.com/sivel/speedtest-cli/master/speedtest.py
#添加权限
chmod a+rx speedtest.py
#执行
python speedtest.py

如果是64位系统则直接besttrace替换besttrace32

演示

PrettyPing.sh

Denilsonsa大佬写的Ping脚本

特点

  • 基本用途相当于 ping 命令
  • 附带了更美观精细地彩色图示

使用

wget https://raw.githubusercontent.com/denilsonsa/prettyping/master/prettyping
mv prettyping /usr/local/bin
chmod +x /usr/local/bin/prettyping
prettyping 目标IP

演示

mPing.sh

Mr.zou大佬写的脚本

特点

  • 方便测试回程Ping值
  • 目前支持众多区域和各大运营商

使用

wget https://raw.githubusercontent.com/helloxz/mping/master/mping.sh
bash mping.sh

演示

Superspeed.sh

老鬼大佬的Superspeed测试脚本

特点

  • 一键全面测速功能
  • 测试服务器到全国北方南方,电信,联通,移动的速度

使用

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

演示

Ping.pe

这个是瓦工出品的丢包测试,可以看到各运营商的丢包数据

小结

都跑一边还是挺需要时间的,如果有好的脚本欢迎分享。

最后感谢各位大佬出品的脚本。