Opened 14 years ago

Last modified 7 years ago

#90 closed enhancement (Implemented)

Bandwidth rate schedules

Reported by: andrewmyers Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: andrewmyers Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I'd like to be able to set a simple schedule in torrc, so's to allow a higher bandwidth cap in the evenings. Something like this:


BandwidthRate 40 kb # default rate cap
BandwidthBurst 400 kb # default bw cap

DaytimeHours 0700 1900 # daytime window (7am - 7pm)
DaytimeBandwidthRate 10 kb # daytime rate cap
DaytimeBandwidthBurst 10 kb # daytime burst size


Yeah, I could do the same thing with a traffic shaper, but I don't need one otherwise.

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (4)

comment:1 Changed 14 years ago by arma

I propose that this sort of thing should be done with the controller interface. Run a little app that
attaches to Tor, sleeps until the appropriate time, and then setconf's bandwidthrate and bandwidthburst.

comment:2 Changed 14 years ago by nickm

Here's a demonstration script that sets config options, using TorControl.py from CVS Tor.
You may need to edit the Python a bit to make it work for you. With a cron job, you can use this
to modify your Tor's bandwidth settings on whatever schedule you wanted.


#!/usr/bin/python
import socket
import sys
import TorControl

def run(options):

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", 9051))
TorControl.authenticate(s)
TorControl.set_option(s, "\n".join(options))

if name == 'main':

if len(sys.argv) < 2:

print "Syntax: SetConfigOptions.py 'option1 value1' 'option2 value2'..."

else:

run(sys.argv[1:])

comment:3 Changed 14 years ago by nickm

flyspray2trac: bug closed.
This is now doable with the Tor controller interface and a cron implementation, as described below.

comment:4 Changed 7 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.