throttle(1) - Linux man page

Name

throttle - bandwidth limiting pipe

Synopsis

throttle [-l fifo | -t fifo ] [-s blocksize ] [-w window ] [-bkmBKM] limit

Description

throttle copies the standard input to the standard output while limiting bandwidth to the specified maximum.

Options

limit
The bandwidth limit in bits, kilobits, megabits, bytes, kilobytes or megabytes per second depending on the options -bkmBKM.
-b, -k, -m
Set the limit unit to bits, kilobits, or megabits per second.
-B, -K, -M
Set the limit unit to bytes, kilobytes, or megabytes per second.
-s blocksize
Set the I/O block size to blocksize bytes. Initially the block size is 512.
-w window
Window of time in seconds used for limit calculation. Initially the window is 60 seconds.
-l fifo
Create fifo and listen for change option messages.
-t fifo
Transmit options to existing throttle process.
-q
Run quietly.
-v
Print informational messages to stderr at window intervals.
-V
Print the version number and copyright and exit.
-h
Display help and exit.

Notes

If SIGUSR1 is received by a running throttle process, it will print statistics to stderr without waiting for the next window and regardless of the verbose option setting.

If SIGUSR2 is received, the fifo will be checked for option change messages without waiting for the next window.

Examples

To limit the bandwidth of a tar back-up to a remote server to 1 Mbit/s, type:

$ tar czf - . | throttle -m 1 | ssh host 'tar xzf - -C /bak'
To start a pipeline which can by dynamically controlled with throttle:
$ ... | throttle -l /tmp/throttle.ctl -m 1 | ... &
This command will start up throttle communicating through the named fifo /tmp/throttle.ctl. In order to send change options to this throttle process, you would need to run another throttle command as:
$ throttle -t /tmp/throttle.ctl [OPTIONS TO CHANGE]

Bugs

Specifying a bandwidth limit greater than the rate of incoming data will not increase the speed of the pipeline.

Author

James Klicman <james at klicman dot org>

See Also

dd(1)