Bandwidth Controller Script for Tor by Bogdan Drozdowski

Some server operators wish to have a tool which would change their Tor server's bandwidth limit at given times. The simplest solution I could come with is the following Perl script:



perl [-pport NNNN] hour1:min1 "bandwidth1" [hour2:min2 "bandwidth2" ...] &
  • NNNN is the Tor control port number (default: 9051)
  • hour1:min1 is the time at which the script should set the Tor bandwidth to bandwidth1
  • bandwidth1 is the bandwidth value, in any format Tor can understand. It should be put in quotes, because running the script as hh:mm 1 MB

will cause the "1 MB" part to be passed as two separate arguments.

  • The & causes the script to be put in background by the shell (works under Bash). This is required (unless you can afford losing a terminal), because the script never exits.

Example: ./ --port 9051 11:37 "500" 11:38 "200"


  • Perl
  • Perl's IO::Socket::INET

License: GPLv2

See also: TheOnionRouter/CronBandwidthLimit

Last modified 5 years ago Last modified on Sep 20, 2011, 5:00:14 PM