「AnyEvent超速分散ダウンローダー」 vs 「wget + fastest server」

404 Blog Not Found:perl - AnyEventで超速分散ダウンローダー をみて v0.02 を実行してみた

結論

  • 分割されたファイルの連結に時間がかかる
  • wget + 一番速いミラーを選ぶのがベスト
  • 定期的に実行して普段使うミラーのベンチを取るのに役立つ(?)

結果

AE分散 on ローカル
$ time perl download.pl ubuntu.yml http://releases.ubuntu.com/10.10/ubuntu-10.10-desktop-i386.iso
# Stage 0: checking headers
Status:         200
Elapsed:        0.7761390209198 sec.
Last-Modified:  Thu, 07 Oct 2010 16:25:11 GMT
Content-Length: 726827008
URLs:
  http://ubuntutym2.u-toyama.ac.jp/ubuntu/10.10/ubuntu-10.10-desktop-i386.iso
  http://ftp.jaist.ac.jp/pub/Linux/ubuntu-releases/10.10/ubuntu-10.10-desktop-i386.iso
  http://releases.ubuntu.com/10.10/ubuntu-10.10-desktop-i386.iso
  http://www.ftp.ne.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso
  http://ftp.riken.jp/Linux/ubuntu-iso/CDs/10.10/ubuntu-10.10-desktop-i386.iso
  http://ubuntu.mithril-linux.org/releases/10.10/ubuntu-10.10-desktop-i386.iso
  http://ftp.yz.yamagata-u.ac.jp/pub/linux/ubuntu/releases/10.10/ubuntu-10.10-desktop-i386.iso
# Stage 1: fetching by pieces
Elapsed: 104.993345022202 sec.
   7 http://ubuntutym2.u-toyama.ac.jp/ubuntu/10.10/ubuntu-10.10-desktop-i386.iso
 151 http://ftp.jaist.ac.jp/pub/Linux/ubuntu-releases/10.10/ubuntu-10.10-desktop-i386.iso
   7 http://releases.ubuntu.com/10.10/ubuntu-10.10-desktop-i386.iso
 217 http://www.ftp.ne.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso
 101 http://ftp.riken.jp/Linux/ubuntu-iso/CDs/10.10/ubuntu-10.10-desktop-i386.iso
 116 http://ubuntu.mithril-linux.org/releases/10.10/ubuntu-10.10-desktop-i386.iso
  95 http://ftp.yz.yamagata-u.ac.jp/pub/linux/ubuntu/releases/10.10/ubuntu-10.10-desktop-i386.iso
# Final Stage: gathering pieces
Elapsed: 113.27496099472 sec.

real	3m39.208s
user	0m19.649s
sys	0m25.834s
AE分散 on さくらVPS
$ time perl download.pl ubuntu.yml http://releases.ubuntu.com/10.10/ubuntu-10.10-desktop-i386.iso
# Stage 0: checking headers
Status:         200
Elapsed:        1.69118595123291 sec.
Last-Modified:  Thu, 07 Oct 2010 16:25:11 GMT
Content-Length: 726827008
URLs:
  http://ubuntutym2.u-toyama.ac.jp/ubuntu/10.10/ubuntu-10.10-desktop-i386.iso
  http://ftp.jaist.ac.jp/pub/Linux/ubuntu-releases/10.10/ubuntu-10.10-desktop-i386.iso
  http://releases.ubuntu.com/10.10/ubuntu-10.10-desktop-i386.iso
  http://www.ftp.ne.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso
  http://ftp.riken.jp/Linux/ubuntu-iso/CDs/10.10/ubuntu-10.10-desktop-i386.iso
  http://ubuntu.mithril-linux.org/releases/10.10/ubuntu-10.10-desktop-i386.iso
  http://ftp.yz.yamagata-u.ac.jp/pub/linux/ubuntu/releases/10.10/ubuntu-10.10-desktop-i386.iso
# Stage 1: fetching by pieces
Elapsed: 89.7977340221405 sec.
  14 http://ubuntutym2.u-toyama.ac.jp/ubuntu/10.10/ubuntu-10.10-desktop-i386.iso
 112 http://ftp.jaist.ac.jp/pub/Linux/ubuntu-releases/10.10/ubuntu-10.10-desktop-i386.iso
   4 http://releases.ubuntu.com/10.10/ubuntu-10.10-desktop-i386.iso
 294 http://www.ftp.ne.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso
 103 http://ftp.riken.jp/Linux/ubuntu-iso/CDs/10.10/ubuntu-10.10-desktop-i386.iso
 136 http://ubuntu.mithril-linux.org/releases/10.10/ubuntu-10.10-desktop-i386.iso
  31 http://ftp.yz.yamagata-u.ac.jp/pub/linux/ubuntu/releases/10.10/ubuntu-10.10-desktop-i386.iso
# Final Stage: gathering pieces
Elapsed: 30.602970123291 sec.

real	2m2.262s
user	0m8.089s
sys	0m30.162s
wget + fastest mirror on さくらVPS

ダウンロード終了後は各URLから何チャンクダウンロードしたかが表示されます。ネットワーク的に遠いサーバーは遅い分それだけ少ないことがきちんと見て取れます。

とあるので、

 294 http://www.ftp.ne.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso

を選ぶ。

$ time wget http://www.ftp.ne.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso
--2010-11-20 08:33:00--  http://www.ftp.ne.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso
Resolving www.ftp.ne.jp... 192.26.91.193, 2001:200:601:10:206:5bff:fef0:466c
Connecting to www.ftp.ne.jp|192.26.91.193|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://ftp-srv2.kddilabs.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso [following]
--2010-11-20 08:33:00--  http://ftp-srv2.kddilabs.jp/Linux/packages/ubuntu/releases-cd/10.10/ubuntu-10.10-desktop-i386.iso
Resolving ftp-srv2.kddilabs.jp... 202.255.47.226
Connecting to ftp-srv2.kddilabs.jp|202.255.47.226|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 726827008 (693M) [application/octet-stream]
Saving to: `ubuntu-10.10-desktop-i386.iso.3'

100%[=============================================================>] 726,827,008 18.9M/s   in 36s     

2010-11-20 08:33:36 (19.4 MB/s) - `ubuntu-10.10-desktop-i386.iso.3' saved [726827008/726827008]


real	0m35.877s
user	0m0.264s
sys	0m8.441s

うーむ。。。