As I have seen more time outs using reflector, I have decided to move over to rate-mirrors and do some testing in that. One question I see repeatedly asked is how do I specify my starting country (knowing the default is the US)? This note below is what I have written to address this.
Simply, the rate-mirrors command parses “rate-mirrors --entry-country=” differently then when you specify get me arch mirrors “rate-mirrors --protocol=https arch”.
Any suggestion to the below note are welcome.
How to Setup Rate-Mirrors to get the fastest Arch Mirrors from your location
Rate-mirrors is a Rust application which will test the speed of various Arch\EndeavourOS mirrors and create a recommended list of completely synced mirrors. The application considers:
TeleGeography data (like submarine cables, internet exchanges).
The starting location you have specified (by default the application assumes the US).
Install Rate-Mirrors application:
sudo pacman -S rate-mirrors
Update Arch Mirror (setting Canada as the starting location) and saving the results to /etc/pacman.d/mirrorlist:
I usually add --max-delay for example, --max-delay 7200.
This ensures you aren’t given out of date mirrors. Otherwise you may be given a mirror that is fast but not up-to-date.
I would also point out that using --entry-country doesn’t actually help much. It only defines the starting point. It can find the fastest mirrors from any starting point.
Thanks for the feedback. Look like the default is already 1.
--completion <COMPLETION>
Minimum mirror sync completion percentage, in a range of 0-1.
If this is below 1, the mirror synchronization is in progress and it's
best to filter out such mirrors [default: 1] [env: RATE_MIRRORS_COMPLETION=]
[default: 1]
Options for rate-mirrors are somewhat different between Arch based distros.
BTW, if possible, you could try with even smaller max-delay values. I’m using approximately 100 as a value here, and it seems to give a good result here. But there can be a location related trade-off between speed and age of mirrors, so experimenting a bit will likely give the best result.
Germany has a high concentration of very fast Arch mirrors, maybe the most in the world. I often get several German mirrors on my list and I am in the US which has a lot of mirrors.
I don’t think that would be a good approach for the general user to take.
@dalto is right: you should not worry about helping rate-mirrors to know your location, default settings should work.
Adjust --max-delay, --protocol (if needed) and whether you want to see comments or not and that’s it.
I created aliases for it a while back, but only use it if I get really slow mirror results once every blue moon. Kind of a rarity throughout the year. I’m lazy like that and probably not needed/efficient(?), but good enough for me.
#
# ~/.bash_aliases
#
# Update mirrors: Arch.
alias update-mirrors="sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak && rate-mirrors arch --max-delay 43200 | sudo tee /etc/pacman.d/mirrorlist"
# Update mirrors: EndeavourOS.
## eos-rankmirrors (official tool EndeavourOS), but with parameter changes.
alias eos-mirrors="eos-rankmirrors --sort rate --timeout 15"
## rate-mirrors.
alias update-mirrors-eos="sudo mv /etc/pacman.d/endeavouros-mirrorlist /etc/pacman.d/endeavouros-mirrorlist.`date +"%Y.%m.%d-%H.%M.%S"` && rate-mirrors endeavouros | sudo tee /etc/pacman.d/endeavouros-mirrorlist"
# Update all mirrors, pacman- and aur packages.
alias update-all="update-mirrors && update-mirrors-eos && paru -Syyu"
Thanks for the feedback WestandSkif. I agree with your outlook that the application just gets the fast complete mirrors by default (even if location assumes the starting location is the US).
I think the reason I am looking at the various switches in the application is to make sure users can configure to their needs. In my case I do prefer:
Starting from Canada.
I only want Arch Mirrors in Canada + US
If possible exclude mirrors from regions I am not familar with (e.g. China + Russian Federation).
This is something configurable in reflector. So part of my learning process to use your application.