怎样测试VPS的性能和线路

2018年12月29日 | 分类: 【技术】

【介绍】

在购买VPS后,常常需要对其性能和线路进行测试,看是否和商家描述相符,以及线路联通状况。

【速度测试】

【工具:Google PageSpeed】

测试网页加载速度。

网址:https://developers.google.com/speed/pagespeed/insights/

【工具:Pingdom.com Page-Speed】

测试网页加载速度。

网址:https://tools.pingdom.com/

【工具:SpeedTest】

测试VPS网络速度。

安装:

wget https://raw.github.com/sivel/speedtest-cli/master/speedtest.py && chmod +x ./speedtest.py && python speedtest.py --share

参考:https://www.wanzhuji.com/262.html?from=hostloc

【路由测试】

【工具:BestTrace】

BestTrace可以查看服务器的去程和回程。一般我们更为关心的是VPS的回程,去程其实没太大所谓,回程才是关键。
去程:本地到VPS的路由。
回程:VPS到本地的路由。

安装:

wget https://cdn.ipip.net/17mon/besttrace4linux.zip && unzip besttrace4linux.zip && chmod +x ./besttrace

使用:

./besttrace 123.123.123.123

123.123.123.123 是本地IP。

参考:https://www.bandwagonhost.net/1186.html

【性能测试】

【工具:Bench.sh】

Bench.sh 耗时较短,几分钟就能完成测试。
Bench.sh 测试结果包括 CPU 型号、CPU 核数、CPU 频率,硬盘大小、内存大小、SWAP 大小、在线时间、负载情况、系统情况、架构和内核版本号,以及硬盘读写速度、到全球各地的下载速度情况等。

安装:

wget -qO- bench.sh | bash

参考:https://teddysun.com/444.html

【工具:UnixBench】

UnixBench 测试用时比较长,一般都需要半个多小时起步。
Unixbench的主要测试项目有:系统调用、读写、进程、图形化测试、2D、3D、管道、运算、C库等系统基准性能提供测试数据。

安装:

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

以上脚本使用了最新版UnixBench5.1.3来测试,注释了关于graphic的测试项(大多数VPS都是没有显卡或者是集显,所以图像性能无需测试),运行10-30分钟后(根据CPU内核数量,运算时间不等)得出分数,越高越好。

参考:https://teddysun.com/245.html
参考:http://www.361way.com/unixbench-benchmark/3437.html
参考:https://www.bandwagonhost.net/2310.html

【工具:SuperBench】

SuperBench.sh 由老鬼开发。查看VPS系统配置信息,硬盘IO,并且进行国内网络测速。

安装:

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