You are not logged in.

#1 2012-02-29 20:35:43

stealthy
Member
Registered: 2011-05-02
Posts: 67

Mirror list optimizer

I've written a mirror list optimizer (mlopt)

Mirror list optimizer (mlopt)

Mlopt is designed to organize your mirrorlist. It fetches JSON data from archlinux.org and uses 
that to sort your new mirror list. The *exact* line you have in your mirror list will be used for 
writting the new list. 

[options]

usage: mlopt [-h] [--w WRITE_DEST] [--a] [--r READ_FROM] [--i]
             [--sort SORT_METHOD] [--reverse] [--l LIMIT] [--v]

Mirror list optimizer (mlopt)

optional arguments:
  -h, --help          show this help message and exit
  --w WRITE_DEST      write servers to file
  --a                 append servers to file
  --r READ_FROM       read servers from path
  --i                 show incomplete servers
  --sort SORT_METHOD  sort mirrorlist by score, last_sync, delay
  --reverse           reverse the sorted mirrorlist
  --l LIMIT           number of servers to show/write
  --v                 show more output



Example usage:

# Read from another file, then write mirrorlist. 
mlopt --r /etc/pacman.d/mirrorlist.pacnew --w /etc/pacman.d/mirrorlist --sort score

# Print servers by score
mlopt --sort score

# Print servers by delay
mlopt --sort delay --v

# Print servers by last_sync (latest are shown first)
mlopt --sort last_sync

https://github.com/Afterburn/mlopt

Report bugs in this thread, or raise a issue on github.com

Sample output:

mlopt --sort score

score: 0.88  http://mirrors.kernel.org/archlinux/
score: 1.46  ftp://mirrors.kernel.org/archlinux/
score: 13.55  http://mirrors.st.uz/archlinux/
score: 15.25  ftp://mirrors.st.uz/archlinux/

mlopt --sort last_sync

last_sync: 2012-02-29 19:00:01 http://mirrors.kernel.org/archlinux/
last_sync: 2012-02-28 21:20:02 ftp://mirrors.st.uz/archlinux/

Last edited by stealthy (2012-03-01 08:37:47)


clipodder-git A small simple cron-friendly podcast downloader, with support for arbitrary user defined media types (pdf, html, etc...)

Offline

#2 2012-03-02 02:55:08

hadrons123
Member
From: chennai
Registered: 2011-10-07
Posts: 1,249

Re: Mirror list optimizer

Its working. How about making it as an AUR package?

[root@candice ~]# mlopt --sort last_sync
last_sync: 2012-03-02 02:00:02 http://mirrors.kernel.org/archlinux/
last_sync: 2012-03-02 01:50:01 http://schlunix.org/archlinux/
last_sync: 2012-03-02 00:20:01 http://mirrors.rutgers.edu/archlinux/
last_sync: 2012-03-01 21:20:01 http://mirrors.lax1.thegcloud.com/arch//
[root@candice ~]# 

LENOVO Y 580 IVYBRIDGE 660M NVIDIA
Unix is user-friendly. It just isn't promiscuous about which users it's friendly with. - Steven King

Offline

#3 2012-03-02 17:52:43

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,810
Website

Re: Mirror list optimizer

Just out of curiosity, are you aware of Reflector?

Offline

#4 2012-03-02 18:04:25

hadrons123
Member
From: chennai
Registered: 2011-10-07
Posts: 1,249

Re: Mirror list optimizer

Not until you posted the link.


LENOVO Y 580 IVYBRIDGE 660M NVIDIA
Unix is user-friendly. It just isn't promiscuous about which users it's friendly with. - Steven King

Offline

#5 2012-03-04 10:45:55

stealthy
Member
Registered: 2011-05-02
Posts: 67

Re: Mirror list optimizer

Xyne, no I was not aware. Looks like you coded it in Python3, which I believe is faster right?. Do you want to team up and code one in C/C++?


clipodder-git A small simple cron-friendly podcast downloader, with support for arbitrary user defined media types (pdf, html, etc...)

Offline

#6 2012-03-04 21:59:40

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,810
Website

Re: Mirror list optimizer

Coding it in C/C++ might be interesting, but I think it's more useful as a Python3 module because it can be used in conjunction with pyalpm and python3-aur. C/C++ might be a bit faster, but it's network-bound, so the speedup would probably be negligible. Python also has the added convenience of a JSON module in the standard library.

Offline

#7 2012-03-16 17:26:34

stealthy
Member
Registered: 2011-05-02
Posts: 67

Re: Mirror list optimizer

Gotta agree.


clipodder-git A small simple cron-friendly podcast downloader, with support for arbitrary user defined media types (pdf, html, etc...)

Offline

Board footer

Powered by FluxBB