2016/07/16 throttleサイトがリンク切れになっていました。
同様のことがpvでできます。
-
-
-
-
-
- -
-
-
-
-
throttleというコマンドを教えてもらった。
帯域制限付きパイプになる。
throttle
http://klicman.org/throttle/
上記サイトからthrottle-1.2.tar.gzをダウンロードして普通に./configure,makeで使える。
$ tar xfz throttle-1.2.tar.gz $ cd throttle-1.2 $ ./configure $ make
大きなファイルをネットワーク負荷を上げずに転送したいときに便利そう。
こんな感じ。
$ throttle オプション < 転送元ファイル > 転送先ファイル
600KBちょっとのファイルを50KBずつコピーした例。
$ time throttle -v -w 1 -K 50 < websvn-2.2.1.tar.gz > websvn.copy throttle: sync min = 0.000149333 throttle: 0B, 0B in 0.000s 0.000K/s -s 512 -w 1 -K 50.000 throttle: 50K, 50K in 1.011s 49.958K/s -s 512 -w 1 -K 50.000 throttle: 101K, 50K in 1.010s 50.001K/s -s 512 -w 1 -K 50.000 throttle: 151K, 50K in 1.011s 49.951K/s -s 512 -w 1 -K 50.000 throttle: 202K, 50K in 1.011s 49.951K/s -s 512 -w 1 -K 50.000 throttle: 252K, 50K in 1.011s 49.950K/s -s 512 -w 1 -K 50.000 throttle: 303K, 50K in 1.011s 49.951K/s -s 512 -w 1 -K 50.000 throttle: 353K, 50K in 1.011s 49.951K/s -s 512 -w 1 -K 50.000 throttle: 404K, 50K in 1.011s 49.951K/s -s 512 -w 1 -K 50.000 throttle: 455K, 51K in 1.021s 49.952K/s -s 512 -w 1 -K 50.000 throttle: 506K, 51K in 1.021s 49.952K/s -s 512 -w 1 -K 50.000 throttle: 556K, 50K in 1.011s 49.951K/s -s 512 -w 1 -K 50.000 throttle: 607K, 50K in 1.011s 49.951K/s -s 512 -w 1 -K 50.000 0.000u 0.005s 0:13.06 0.0% 0+0k 0+0io 0pf+0w $
slコマンドを流しても面白いかも。