LoginSignup
2
1

More than 5 years have passed since last update.

Stretcher v0.5.0 でダウンロードの帯域制限とタイムアウト

Posted at

Stretcher v0.5.0 でダウンロードの帯域制限とタイムアウト機能を追加しました。

$ stretcher -h
Usage of stretcher:
  -max-bandwidth string
        max bandwidth for download src archives (Bytes/sec)
  -random-delay float
        sleep [0,random-delay) sec on start
  -timeout int
        timeout for download src archives (sec)

帯域制限 -max-bandwidth

manifestのsrcに指定したアーカイブは往々にして巨大になるため、アーカイブの取得でネットワーク帯域を使い果たさないように制限するオプションです。
単位は Bytes/Sec で、go-humanize が解釈できる形式のsuffixも付けられます。

例: 10MB/sec に制限したい場合 -max-bandwidth 10m

-random-delay と合わせて、取得元への負荷をコントロールするのに有用かと思います。
自作の shapeio というライブラリを使用しています。

取得のタイムアウト -timeout

アーカイブの取得のタイムアウト設定(単位 秒)です。
srcの取得(ローカルファイルへの書き込みを含む)が指定時間内に終了しない場合、処理が中止されます。

アーカイブ取得部分のみのタイムアウト設定なので、pre, post等のコマンド実行やtarの展開、rsyncには掛かりません。

どうぞご利用ください。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1