1.背景

自建了web服务有时候服务卡顿的时候想要测试一下客户端到服务器的带宽,使用专门的工具比较繁琐。因此考虑在服务器上搭建speedtest

2.搭建步骤(基于宝塔)

2.1 创建站点

可以用域名-需要实现解析,也可以用IP:端口的方式访问

image-20221123194539341

$\color{red}{上面有个错误示范,PHP版本需要选,不能不指定PHP}$

2.2 下载源码

cd /www/wwwroot/speedtest.inat.top
wget https://codeload.github.com/librespeed/speedtest/tar.gz/refs/tags/5.2.5/speedtest-5.2.5.tar.gz
tar xzvf speedtest-5.2.5.tar.gz
mv speedtest-5.2.5/* ./

2.3 修改首页

rm index.html
cp example-singleServer-full.html index.html

2.4 访问测试

image-20221123195824866

参考资料

1.https://github.com/librespeed/speedtest

Last modification:November 23rd, 2022 at 08:01 pm
如果觉得我的文章对你有用,请随意赞赏