Hi Harald

On Wed, Jul 22, 2009 at 07:07:09AM -0700, Harald Schilly wrote:
> Below is a link to a python script that tests the active and up-to-
> date mirrors, selects one of the 3 fastest (to be "fair" and
> distribute the load, there is much random noise anyways) and then
> returns the link to the now mirrored standard packages. I think that's
> a nice addition, but I'm not familiar with the "sage -update" script
> and the whole process. So, someone should look into this please. Tell
> me if the script works for you!
> 
> http://sage.math.washington.edu/home/schilly/sage_mirror_upgrade.py

Well, the choosing from the top three was not so good;
rerunning makes that mirror clearly the worst. There aren't 
many, and seem to get them all in a few runs. Perhaps the random
noise is enough of randomness...?

0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.switch.ch                 419 [ms]
mirror.yandex.ru                 710 [ms]
modular.math.jmu.edu            1168 [ms]
modular.fas.harvard.edu         1251 [ms]
www.cecm.sfu.ca                 1311 [ms]
sagemath.c3sl.ufpr.br           1911 [ms]

selected mirror: http://mirror.switch.ch/mirror/sagemath/packages/standard/

You test this by opening index.html? Everything here is
proxied, and in low bandwidth environments HAVE to be proxied.
By policy and techically enforced. 

So the one I chose is the only one not proxied? :(

0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.yandex.ru                   3 [ms]
modular.math.jmu.edu               6 [ms]
modular.fas.harvard.edu            7 [ms]
www.cecm.sfu.ca                    7 [ms]
sagemath.c3sl.ufpr.br              8 [ms]
mirror.switch.ch                 363 [ms]

selected mirror: http://modular.math.jmu.edu/packages/standard/
0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.yandex.ru                   3 [ms]
www.cecm.sfu.ca                    5 [ms]
modular.math.jmu.edu               6 [ms]
sagemath.c3sl.ufpr.br              6 [ms]
modular.fas.harvard.edu            8 [ms]
mirror.switch.ch                 398 [ms]

selected mirror: 
http://mirror.yandex.ru/mirrors/sage.math.washington.edu/packages/standard/
0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.yandex.ru                   3 [ms]
modular.fas.harvard.edu            7 [ms]
www.cecm.sfu.ca                    7 [ms]
 modular.math.jmu.edu               8 [ms]
sagemath.c3sl.ufpr.br              8 [ms]
mirror.switch.ch                 368 [ms]

selected mirror: http://www.cecm.sfu.ca/sage/packages/standard/


Gar, enough of that.

So I comment out random.shuffle(top) and try again, and get the same
one all the time:


0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.yandex.ru                   3 [ms]
www.cecm.sfu.ca                    5 [ms]
modular.math.jmu.edu               6 [ms]
modular.fas.harvard.edu            7 [ms]
sagemath.c3sl.ufpr.br              7 [ms]
mirror.switch.ch                 363 [ms]

selected mirror: 
http://mirror.yandex.ru/mirrors/sage.math.washington.edu/packages/standard/
0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.yandex.ru                   3 [ms]
modular.fas.harvard.edu            4 [ms]
modular.math.jmu.edu               5 [ms]
sagemath.c3sl.ufpr.br              9 [ms]
www.cecm.sfu.ca                   10 [ms]
mirror.switch.ch                 363 [ms]

selected mirror: 
http://mirror.yandex.ru/mirrors/sage.math.washington.edu/packages/standard/
0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.yandex.ru                   2 [ms]
modular.fas.harvard.edu            6 [ms]
www.cecm.sfu.ca                    5 [ms]
modular.math.jmu.edu               6 [ms]
sagemath.c3sl.ufpr.br              6 [ms]
mirror.switch.ch                 372 [ms]

selected mirror: 
http://mirror.yandex.ru/mirrors/sage.math.washington.edu/packages/standard/
0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.yandex.ru                   3 [ms]
modular.math.jmu.edu               7 [ms]
sagemath.c3sl.ufpr.br              8 [ms]
modular.fas.harvard.edu           10 [ms]
www.cecm.sfu.ca                    9 [ms]
mirror.switch.ch                 453 [ms]

selected mirror: 
http://mirror.yandex.ru/mirrors/sage.math.washington.edu/packages/standard/
0 j...@muizenberg:~$python sage_mirror_upgrade.py 
mirror.yandex.ru                   3 [ms]
modular.fas.harvard.edu            3 [ms]
sagemath.c3sl.ufpr.br              6 [ms]
modular.math.jmu.edu               7 [ms]
www.cecm.sfu.ca                   11 [ms]
mirror.switch.ch                 371 [ms]

selected mirror: 
http://mirror.yandex.ru/mirrors/sage.math.washington.edu/packages/standard/


So I see my local mirror sun.ac.za is not there? Because the tar is not 
unpacked there?

Also, I would print the actual command to run:
sage -upgrade http://...

A ping time would be better than opening. We have pings in the country of 
1-100ms
and through to Europe/US at 400-800.
(Debian does this, I think, and mistakenly keeps giving me mirrors in Eastern 
Europe)
Then again some servers don't allow pings...

--- echidna.maths.usyd.edu.au ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3998ms
rtt min/avg/max/mdev = 504.555/531.527/548.337/16.717 ms
--- mimas-nxge0.switch.ch ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 175.483/199.152/249.654/28.797 ms
--- mirror.yandex.ru ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4332ms
rtt min/avg/max/mdev = 206.620/230.290/241.420/12.302 ms
--- modular.fas.harvard.edu ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4031ms
--- modular.math.jmu.edu ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4030ms
--- sagres.c3sl.ufpr.br ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4677ms
rtt min/avg/max/mdev = 388.971/405.773/434.684/16.217 ms
--- newweb.cecm.sfu.ca ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4889ms
rtt min/avg/max/mdev = 310.205/339.340/384.164/27.543 ms
--- ftp.sun.ac.za ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 52.209/53.966/55.909/1.346 ms

A clear winner there for the local mirror (last, not on your list)

So the proxy messes it all up, but I added 
mirrors.append('ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/')
and tried again.

0 j...@muizenberg:~$python sage_mirror_upgrade.py 
echidna.maths.usyd.edu.au          4 [ms]
www.cecm.sfu.ca                    3 [ms]
sagemath.c3sl.ufpr.br              8 [ms]
 modular.math.jmu.edu               8 [ms]
modular.fas.harvard.edu            9 [ms]
mirror.yandex.ru                  10 [ms]
mirror.switch.ch                 372 [ms]
ftp.sun.ac.za                    743 [ms]

selected mirror: http://www.cecm.sfu.ca/sage/packages/standard/
0 j...@muizenberg:~$python sage_mirror_upgrade.py 
echidna.maths.usyd.edu.au          2 [ms]
sagemath.c3sl.ufpr.br              6 [ms]
modular.fas.harvard.edu            6 [ms]
mirror.yandex.ru                   7 [ms]
www.cecm.sfu.ca                    6 [ms]
modular.math.jmu.edu               7 [ms]
mirror.switch.ch                 389 [ms]
ftp.sun.ac.za                    656 [ms]

selected mirror: http://echidna.maths.usyd.edu.au/sage/packages/standard/


hmm, ftp is not proxied. So I chanved to 
mirrors.append('http://ftp.sun.ac.za/ftp/.sdb1/www.sagemath.org2/')

0 j...@muizenberg:~$python sage_mirror_upgrade.py 
echidna.maths.usyd.edu.au          3 [ms]
modular.fas.harvard.edu            6 [ms]
modular.math.jmu.edu               6 [ms]
www.cecm.sfu.ca                    6 [ms]
mirror.yandex.ru                   8 [ms]
sagemath.c3sl.ufpr.br              8 [ms]
ftp.sun.ac.za                    129 [ms]
mirror.switch.ch                 471 [ms]

selected mirror: http://echidna.maths.usyd.edu.au/sage/packages/standard/
0 j...@muizenberg:~$python sage_mirror_upgrade.py 
echidna.maths.usyd.edu.au          4 [ms]
ftp.sun.ac.za                      7 [ms]
mirror.yandex.ru                   9 [ms]
sagemath.c3sl.ufpr.br              8 [ms]
modular.fas.harvard.edu           11 [ms]
www.cecm.sfu.ca                   11 [ms]
modular.math.jmu.edu              15 [ms]
mirror.switch.ch                 367 [ms]

selected mirror: http://echidna.maths.usyd.edu.au/sage/packages/standard/

getting there?... So I log onto the proxy and unset http_proxy
and try again: oops  no function u.getcode. So I uncomment that
for the moment and try again:

This looks more realistic:

0 j...@musselcracker:~$python sage_mirror_upgrade.py 
ftp.sun.ac.za                    190 [ms]
mirror.switch.ch                 485 [ms]
mirror.yandex.ru                 530 [ms]
modular.math.jmu.edu             614 [ms]
modular.fas.harvard.edu          661 [ms]
www.cecm.sfu.ca                  730 [ms]
sagemath.c3sl.ufpr.br            929 [ms]
echidna.maths.usyd.edu.au       1051 [ms]

selected mirror: 
http://ftp.sun.ac.za/ftp/.sdb1/www.sagemath.org2/packages/standard/

0 j...@musselcracker:~$python sage_mirror_upgrade.py 
ftp.sun.ac.za                    126 [ms]
mirror.switch.ch                 375 [ms]
modular.math.jmu.edu             518 [ms]
mirror.yandex.ru                 532 [ms]
modular.fas.harvard.edu          567 [ms]
www.cecm.sfu.ca                  640 [ms]
sagemath.c3sl.ufpr.br            796 [ms]
echidna.maths.usyd.edu.au        954 [ms]

selected mirror: 
http://ftp.sun.ac.za/ftp/.sdb1/www.sagemath.org2/packages/standard/


And really, as a sysadm, I found out which mirror to use.
I was more thinking about the end user who wants it transparantly.
But this is a good start!

regards,
Jan

--
   .~. 
   /V\     Jan Groenewald
  /( )\    www.aims.ac.za
  ^^-^^ 

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to