throttle is a tool that acts as a bandwidth limiting pipe.
throttle [−l fifo | −t fifo ] [−s blocksize ] [−w window ] [−bkmBKM] limit
throttle copies the standard input to the standard output while limiting bandwidth to the specified maximum.
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.
Set the I/O block size to blocksize bytes. Initially the block size is 512.
Window of time in seconds used for limit calculation. Initially the window is 60 seconds.
Create fifo and listen for change option messages.
Transmit options to existing throttle process.
Print informational messages to stderr at window intervals.
Print the version number and copyright and exit.
Display help and exit.
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.
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]
What's New in This Release:
· This release adds improved portability, clock_gettime support, minimum sleep calibration, improved sub-second sleep functions, dynamic option controls, periodic statistics messages, 64-bit counters, and an updated RPM spec file.