How to select best mirror for slackpkg
Hi all
I have a problem with selecting fastest mirror for slackpkg. It seems that nearest mirror is not always the best as Turkey and Greece mirrors doesn't provide good speed and also suffer from occasional disconnecting on my system. I wonder is there a specific tool for selecting best mirror for slackpkg? something like netselect-apt for debian or mirrorselect for gentoo? I didn't find anything useful by searching |
Ping them?
You can also try using mirrors.slackware.com as your mirror. |
You could make a script to grep all the mirrors from the mirrors file and then ping each one of them in a loop while reporting back the results and then use something like sort to have the fastest at the top.
|
Quote:
I have to read some documents as I am not familiar with ping. I didn't understand your point. Do you mean adding http://mirrors.slackware.com/ to /etc/slackpkg/mirrors or choosing one of the mirrors from available mirrors section? Quote:
|
Quote:
|
Quote:
I'll post it here if anyone has an idea. Code:
#! /bin/sh |
Quote:
Cheers, Niki |
My understanding is that mirrors.slackware.com is somehow a "meta-mirror" that redirects the download requests using mirrorbrain to handle the traffic and share it between mirrors.
I do not know how load balancing is configured in case of mirrors.slackware.com, but I assume that the mirrors' locations is one of the main parameters to be considered. For that reason I am not sure that travis82's issue can be solved setting it in /etc/slackpkg/mirrors, But that's certainly worth trying. @Hosein: could you please try it if not already done, see if that makes a difference and report here? Also, if Robby Workman reads this thread, I hope he will shed some light. |
Quote:
So for Slackware it is probably a lot easier than it sounds with the mirrorlist being a plain text-file already, first step would be to get netselect working and then it is a matter of output parsing as the best server is the one on the last line of the netselect output. edit) first link to netselect doesn't give the source, it is on github. See: https://github.com/apenwarr/netselect |
I tested mirrors.slackware.com. According to slackpkg/mirror it finds a nearby mirror. The odd thing is that it selected http://hkg.mirror.rackspace.com/slackware/ in Hong Kong as nearest mirror (perhaps I am living in China, I don't know). Anyway, my experience with hk mirror is horrible.
I guess I have to check all available slackware mirrors by ping. |
This will get you a list of mirrors and the speed it takes to wget their index.html which could narrow down a fast mirror, I haven't figured out how to sort the output well yet... Don't forget to pass SLVER=14.1 if you aren't using current or just edit the SLKVER line in the script.
Code:
#! /bin/sh |
Another solution with ping. This is a draft, of course.
Only mirrors with 0 packet loss are listed. Results can vary upon time needed for name resolution. Use a good name server. Sort criteria: minimum response time, fastest at the bottom to avoid scrolling. Code:
#!/bin/sh |
Thank you both. I will test them tonight.
@Didier What do you mean by "use a good name server"? |
Quote:
For that we query one of the name servers whose IP addresses are listed in /etc/resolv.conf. But, if that name server is slow to respond for any reason, this will delay access to the mirror. Even worse, if the name server is buggy or its cache not updated, this can make the mirror unreachable, unless you know its IP address and use it instead of the domain name. I have sometimes used Google's public DNS addresses 8.8.8.8 and 4.4.4.4 as they are reliable. For that you can just write your /etc/resolv.conf like this: Code:
bash-4.2# cat /etc/resolv.conf Code:
chmod 444 /etc/resolv.conf |
I tested theses scripts. Here is the output of orbea's script (I omitted outputs for current mirrors):
Code:
ftp://mirrors.slackware.com:/slackware/slackware-14.1/ Code:
594.724 ftp.cc.swin.edu.au Code:
# Generated by NetworkManager |
All times are GMT -5. The time now is 04:56 AM. |