speedtest.net是一个的互联网带宽测试网站。可测试本机到互联网的上传/下载/延时等。如果局域网内要测试网速的话,比如WIFI下载性能,speedtest.net就爱莫能助了。
幸运的是,librespeed提供speedtest(官网https://librespeed.org/),可部署在局域网的服务器上。在局域网内其他主机,访问该服务器上的web页面,即可进行局域网测速。
以下以Windows + PHPStudy部署speedtest。其他平台部署请在bing里搜索。
1. 下载并安装Windows版本phpstudy(phpstudy官方主页 https://www.xp.cn/)
下载最新版本,进行安装。安装的时候,选择一下要安装到的硬盘及路径,注意无中文。
运行phpstudy,在WNMP的位置,点击启动,启动NGINX/MySQL
2. 下载speedtest代码
访问 https://github.com/librespeed/speedtest,下载code:code-download zip
3. 解压已经下载的speedtest压缩包。copy所有文件到PHPStudy安装目录下的WWW。
4. 访问http://localhost/example-singleServer-full.html应该可以看到speedtest页面
5. 优化
可以将example-singleServer-full.html重命名为index.html. 这样访问的时候,使用http://localhost 即可访问
6. 其他电脑测速
其他访问该服务器地址进行速度测试 - http://x.x.x.x, 其中x.x.x.x为该服务器的IP
测速结果,还可以写入mysql。请自行在cn.bing.com上搜索。并进行配置。
Over