Skip to content

Debian mirrors speed tester & mirror changer

License

Notifications You must be signed in to change notification settings

GeekerHWH/mirrorSpeedTest

Repository files navigation

A project for Testing Debian/Ubuntu mirrors

This tool is mainly to help Debian users to select the best apt Repo for themselves, especially for people who live in China with a special Network Environment, now it has supported people all of the world.

I know there are some netselect tools, but the most important thing when downloading is BANDWITH The software requirements are all based on my personal experience in the source switching workflow. The project is highly experimental, if you have any suggestions for improving the software experience, feel free to open an issue or submit a pull request!

If you need support for your country as quick as possible, feel free to email me [email protected] all I wish is your stars. XD

Project Highlights

  • Multi-threads speed(bandwith) and latency testing implemented using go routine
  • support both passing parameters and interacting mode
  • support different countries in the world
  • Docker to contanerize the app for easy deployment
  • GitHub Actions to automate testing
  • No need for sudo if you don't want to change apt source list

Demo

support mirrors all around the world, CN(local) and US(GithubActions with Docker)

CN US

Features

  • -i enter interactive mode
  • --url specify a single url
  • -c specify two-letter country abbreviation for your country

    e.g. USfor American Mirrors; CN for Chinese Mirrors

How to use it?

to test mirrors' speeds:

There are 3 ways to run speed testing

Run with Docker(cmd mode)

  • use --url to specify a single mirror url
  • or use -c to choose your country
sudo docker run geekerhwh/mst:latest ./mirrorSpeedTest -c US

Run with Docker(interactive mode)

  1. make sure docker is installed then run:
sudo docker run geekerhwh/mst:latest ./mirrorSpeedTest -i US

or Run with the binary file

  1. Download the mirrorSpeedTest and urls.json file(make sure files are in the same directory)
  2. make sure the binary file has priviledge to be executed
chmod 777 ./mirrorSpeedTest
  1. run it in terminal
./mirrorSpeedTest -c US

or If you want to run with go runtime

  1. make sure your computer has the Go runtime installed
go env
  1. enter the directory of this project, then open the terminal to run:
go run main/main.go -c US
  1. follow the instruction of the app to get your best mirror(English version coming soon)

to change to the best mirror after Testing(experimental)

# running in root is needed
sudo ./changeMirror.sh

What's next

  • added changeMirror.sh to change the mirror supported by default
  • multi choose mirrors to test
  • support choose all in multi choice mode
  • check whether the host OS is Debian
  • support sorting from best to worst
  • support worldwide mirrors(almost all debian mirror)

Check [Debian Worldwide Mirror Lists]

  • support multi-threads testing in parallel(check task/tester.go)
  • support multi-threads latency testing in parallel
  • support choose country in interactive mode(Default mirror is TsingHua in CN)
  • interactive mode default mirror should change to the first in the choosed country
  • support conda and pip mirror testing
  • support geo-based mirrors testing to present perfect suggestion
  • support passing parameters for speed testing
  • support passing multi parameters(countries) for Europe user
  • containerize the app so that skip install go runtime
  • support integrated apt sourcelist file editting(default choose the fastest)
  • use Github Actions to automate testing
  • tuning the performance
  • tuning the RAM usage
  • beyond my imagination...