Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mirror selection process #15

Open
nroi opened this issue Apr 23, 2019 · 2 comments
Open

Improve mirror selection process #15

nroi opened this issue Apr 23, 2019 · 2 comments

Comments

@nroi
Copy link
Owner

nroi commented Apr 23, 2019

With the current approach, there is a trade off concerning the mirrors_auto.num_mirrors variable:

  • Higher values increase the startup time of cpcache
  • Lower values could result in slow mirrors being selected. Also, it's not ideal if all cpcache users will only use top-ranking mirrors: that means load will be increased on already popular mirrors. Instead, load should be balanced among all mirrors.

Perhaps there is a way to do a sort of fast preselection before the actual latency tests are run. For instance, ICMP could be used to ping hosts and sort them by their round trip time.

@nroi
Copy link
Owner Author

nroi commented Apr 27, 2019

ICMP is not directly supported by Erlang and no hex.pm repository for ICMP exists, so testing the TCP connection delay would probably be more straightforward. Consider the delay for DNS resoution, which we don't want to measure. Something like:

:inet.getaddr('ipv4.xnet.space', :inet) # -> {:ok, {78, 46, 175, 29}}
:timer.tc(:gen_tcp, :connect, [{78, 46, 175, 29}, 80, [:binary]])

@nroi
Copy link
Owner Author

nroi commented May 19, 2019

Looks like the new experimental socket API does support ICMP:
http://erlang.org/doc/man/socket.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant