Last active
May 28, 2024 05:34
-
-
Save lathiat/66aba5d43e2d487057d8e3322e3ecf5a to your computer and use it in GitHub Desktop.
Test download speed and collect data/statistics from rsync.archive.ubuntu.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -xe | |
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT | |
testrun=$(date -Isecond) | |
mkdir -p ~/test-mirror/${testrun} | |
cd ~/test-mirror/${testrun} | |
# ~400M -rw-r--r-- 421,586,560 2024/01/09 17:36:50 linux-source-6.2.0_6.2.0-41.42_all.deb | |
# ~100M -rw-r--r-- 98,862,464 2019/01/17 13:08:52 linux-source-3.13.0_3.13.0-165.215_all.deb | |
test_path=ubuntu/pool/main/l/linux | |
test_file=linux-source-3.13.0_3.13.0-165.215_all.deb | |
rsync_ips=$(host rsync.archive.ubuntu.com|awk '{print $NF}') | |
for r in ${rsync_ips}; do | |
rm ${test_file} || true | |
tcpdump --no-promiscuous-mode -ni br0 host ${r} -s 65535 -w pcap.${r} & | |
time rsync -va --progress "[${r}]::${test_path}/${test_file}" . &> rsync.${r} | |
sleep 1 | |
ss -ni |grep -A1 ${r} &> ss.${r} | |
kill %- | |
rm ${test_file} || true | |
time rsync -va --progress "[${r}]::${test_path}/${test_file}" . &> rsync2.${r} | |
done | |
for result in rsync.*; do | |
IP=${result#rsync.} | |
echo ${result} | |
grep xfr rsync.${IP} | |
grep xfr rsync2.${IP} | |
#cat ss.${IP} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A case where the first retrieval was fast then the second was super slow for some reason, but only from 185.125.190.39