国内镜像源的测试实践
  

静态路由 3683

{{ttag.title}}
本帖最后由 静态路由 于 2019-9-24 18:06 编辑

       根据自己的网络,如何选择一个适合自己的镜像源呢?上次我分享了一个通过centos下yum安装搭建cacti,然后就引发思考了,我选择的镜像源速度是最快的吗?那么就选定国内知名的镜像源来个测试,供大家参考如果是公有云服务器或者像某公司这种提供企业云的话,肯定是选择厂商内网的镜像源啦,内网传输速度超快,所以这次的测试仅仅针对于办公或家用网络哈。好像某公司还没有在公有云市场投放吧,没有搜索某公司的公开镜像源,就测了其他主流的了。
      
中科大        https://mirrors.ustc.edu.cn/
163        https://mirrors.163.com/
某公司        https://mirrors.aliyun.com/
测试系统
选用 debian 10 ,安装的软件包有xfce4 gnome libreoffice vlc ,这三个包总大小 1014MB。
测试过程
公司办公网络是500M网,外网访问速度最快只能到53M/S。测试方法很简单,使用 sed 替换掉原来的镜像域名就行,都使用 http 的方式下载 加上 -d 参数只下载即可通过下载上面三个包,然后看那个最快来作为测试最优镜像源。

sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
sed -i 's|security.debian.org/debian-security|mirrors.aliyun.com/debian-security|g' /etc/apt/sources.list
time apt update
time apt install xfce4 gnome libreoffice  vlc -d -y

下面开始测试
清华
set -xue
sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
sed -i 's|security.debian.org/debian-security|mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list
apt update
root@6586bff7e2bf:/# time apt update
Get:1 http://mirrors.tuna.tsinghua.edu.cn/debian buster InRelease [122 kB]
Get:2 http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates InRelease [39.1 kB]
Get:3 http://mirrors.tuna.tsinghua.edu.cn/debian buster-updates InRelease [49.3 kB]
Get:4 http://mirrors.tuna.tsinghua.edu.cn/debian buster/main amd64 Packages [7899 kB]
Get:5 http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates/main amd64 Packages [85.3 kB]
Get:6 http://mirrors.tuna.tsinghua.edu.cn/debian buster-updates/main amd64 Packages [884 B]
Fetched 8195 kB in 2s (3821 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

apt install xfce4 gnome libreoffice  vlc -d -y
0 upgraded, 1574 newly installed, 0 to remove and 0 not upgraded.
Need to get 1014 MB of archives.
After this operation, 3471 MB of additional disk space will be used.
Fetched 1014 MB in 2min 3s (8246 kB/s)
Download complete and in download only mode
测试结果 Fetched 1014 MB in 2min 3s (8246 kB/s)

中科大
sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
apt update
root@1242bc5d5e5a:/# time apt update
Get:1 http://mirrors.ustc.edu.cn/debian buster InRelease [122 kB]
Get:2 http://mirrors.ustc.edu.cn/debian-security buster/updates InRelease [39.1 kB]
Get:3 http://mirrors.ustc.edu.cn/debian buster-updates InRelease [49.3 kB]
Get:4 http://mirrors.ustc.edu.cn/debian buster/main amd64 Packages [7899 kB]
Get:5 http://mirrors.ustc.edu.cn/debian-security buster/updates/main amd64 Packages [85.3 kB]
Get:6 http://mirrors.ustc.edu.cn/debian buster-updates/main amd64 Packages [884 B]
Fetched 8195 kB in 4s (1896 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

apt install xfce4 gnome libreoffice  vlc -d -y
0 upgraded, 1574 newly installed, 0 to remove and 0 not upgraded.
Need to get 1014 MB of archives.
Fetched 1005 MB in 37min 31s (446 kB/s)
测试结果 Fetched 1005 MB in 37min 31s (446 kB/s)

163
sed -i 's/deb.debian.org/mirrors.163.com/g' /etc/apt/sources.list
sed -i 's|security.debian.org/debian-security|mirrors.163.com/debian-security|g' /etc/apt/sources.list
apt update
root@66e0d532818e:/# apt update
Get:1 http://mirrors.163.com/debian buster InRelease [122 kB]
Get:2 http://mirrors.163.com/debian-security buster/updates InRelease [39.1 kB]
Get:3 http://mirrors.163.com/debian buster-updates InRelease [49.3 kB]
Get:4 http://mirrors.163.com/debian buster/main amd64 Packages [7899 kB]
Get:5 http://mirrors.163.com/debian-security buster/updates/main amd64 Packages [85.3 kB]
Get:6 http://mirrors.163.com/debian buster-updates/main amd64 Packages [884 B]
Fetched 8195 kB in 3s (2939 kB/s)

apt install xfce4 gnome libreoffice  vlc -d -y
0 upgraded, 1574 newly installed, 0 to remove and 0 not upgraded.
Need to get 1014 MB of archives.

Fetched 1012 MB in 7min 21s (2295 kB/s)
Download complete and in download only mode
测试结果 Fetched 1012 MB in 7min 21s (2295 kB/s)

某公司
sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
sed -i 's|security.debian.org/debian-security|mirrors.aliyun.com/debian-security|g' /etc/apt/sources.list
root@e4b82e40b6c6:/# apt update
Get:1 http://mirrors.aliyun.com/debian buster InRelease [122 kB]
Get:2 http://mirrors.aliyun.com/debian-security buster/updates InRelease [39.1 kB]
Get:3 http://mirrors.aliyun.com/debian buster-updates InRelease [49.3 kB]
Get:4 http://mirrors.aliyun.com/debian buster/main amd64 Packages [7899 kB]
Get:5 http://mirrors.aliyun.com/debian-security buster/updates/main amd64 Packages [85.3 kB]
Get:6 http://mirrors.aliyun.com/debian buster-updates/main amd64 Packages [884 B]
Fetched 8195 kB in 1s (6489 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

apt install xfce4 gnome libreoffice  vlc -d -y
0 upgraded, 1574 newly installed, 0 to remove and 0 not upgraded.
Need to get 1014 MB of archives.
After this operation, 3471 MB of additional disk space will be used.
Fetched 1014 MB in 2min 54s (5815 kB/s)
Download complete and in download only mode
测试结果 Fetched 1014 MB in 2min 54s (5815 kB/s)

华为
sed -i 's/deb.debian.org/mirrors.huaweicloud.com/g' /etc/apt/sources.list
sed -i 's|security.debian.org/debian-security|mirrors.huaweicloud.com/debian-security|g' /etc/apt/sources.list
apt update

root@659549fb7f12:/# apt update
Get:1 http://mirrors.huaweicloud.com/debian buster InRelease [122 kB]
Get:2 http://mirrors.huaweicloud.com/debian-security buster/updates InRelease [39.1 kB]
Get:3 http://mirrors.huaweicloud.com/debian buster-updates InRelease [49.3 kB]
Get:4 http://mirrors.huaweicloud.com/debian buster/main amd64 Packages [7899 kB]
Get:5 http://mirrors.huaweicloud.com/debian-security buster/updates/main amd64 Packages [85.0 kB]
Get:6 http://mirrors.huaweicloud.com/debian buster-updates/main amd64 Packages [884 B]
Fetched 8194 kB in 2s (4766 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

apt install xfce4 gnome libreoffice  vlc -d -y
0 upgraded, 1574 newly installed, 0 to remove and 0 not upgraded.
Need to get 1014 MB of archives.
After this operation, 3471 MB of additional disk space will be used.
Fetched 1014 MB in 1min 25s (12.0 MB/s)
Download complete and in download only mode
测试结果 Fetched 1014 MB in 1min 25s (12.0 MB/s)

汇总:
清华:2min 3s
中科大:37min 31s
163:7min 21s
某公司:2min 54s
华为:1min 25s

下载同样的包,使用华为的镜像源更快一点。当然这个结果也只是参考,这和本地的网络运营商,所处的地理位置也有关。之前我自己的测试环境服务器一直在使用某公司或者中科大的镜像站,今天一测才知道,华为的还快一点呢。

分享这个呢是想告诉大家,希望大家都能够用实践用数据来支撑自己的选择。

打赏鼓励作者,期待更多好文!

打赏
2人已打赏

静态路由 发表于 2019-9-24 18:06
  
发完准备下班了
Sangfor_闪电回_朱丽 发表于 2019-9-26 09:59
  
感谢带来运维技巧分享!
droprains 发表于 2019-9-27 09:21
  
谢谢分享
发表新帖
热门标签
全部标签>
每日一问
技术盲盒
干货满满
技术笔记
新版本体验
产品连连看
GIF动图学习
技术咨询
自助服务平台操作指引
标准化排查
2023技术争霸赛专题
功能体验
通用技术
秒懂零信任
信服课堂视频
社区帮助指南
答题自测
安装部署配置
上网策略
运维工具
SANGFOR资讯
设备维护
技术晨报
每日一记
用户认证
项目案例
玩转零信任
深信服技术支持平台
畅聊IT
专家问答
技术圆桌
在线直播
MVP
网络基础知识
升级
安全攻防
测试报告
日志审计
问题分析处理
流量管理
云计算知识
原创分享
解决方案
sangfor周刊
VPN 对接
专家分享
技术顾问
信服故事
SDP百科
功能咨询
终端接入
授权
资源访问
地址转换
虚拟机
存储
迁移
加速技术
排障笔记本
产品预警公告
信服圈儿
S豆商城资讯
技术争霸赛
「智能机器人」
追光者计划
答题榜单公布
纪元平台
卧龙计划
华北区拉练
天逸直播
以战代练
山东区技术晨报
文档捉虫活动
齐鲁TV
华北区交付直播
每周精选

本版版主

461
244
13

发帖

粉丝

关注

本版达人

feeling

本周分享达人

新手29676...

本周提问达人