Content-type: text/html
pyshaper - Simple yet versatile dynamic bandwidth manager
pyshaper [<options>]
pyshaper [<options>] start
pyshaper stop
pyshaper help
pyshaper reload
pyshaper status
pyshaper is a daemon which dynamically manages your incoming and outgoing bandwidth allocations.
Its main purpose is for people in countries like New Zealand and Australia, where the telcos routinely indulge in monopoly price-gouging, and broadband connectivity is hobbled by meagre traffic caps (as little as 400MB/month) with harsh fees for excess traffic.
With pyshaper you can safely run internet programs, and leave them running, without fear of maxing out your monthly traffic allowances. You can easily set up high-level classes (traffic categories), and enforce strict priorities and bandwidth limits for connections which fall into each of these classes.
In contrast to 'bare-bones' traffic shaping programs like tc(8), and the various 'tc-wrapper' programs, pyshaper is simple to configure and use, and allows you to create bandwidth allocations which will be dynamically applied in real time to the current TCP connections, based on sophisticated combinations of attributes such as:
pyshaper periodically scans the current TCP connections from the local computer (by default, once every 30 seconds), and matches them against your chosen rules - a simple set of boolean expressions in your configuration file.
For each connection that matches one of your rules, pyshaper runs the appropriate tc(8) commands to dynamically set the priority, and shape the outgoing (and incoming) bandwidth allocation, for that connection.
What makes pyshaper unique is its dynamic shaping feature.
Most 'tc-wrapping' traffic shaping programs just pass a set of static shaping rules to tc. Such static rules can only match on local and remote hostname and port (unless of course you're a nuts-n-bolts networking wizard, and can write iptables(1) rules in your sleep).
But since pyshaper periodically scans all active connections, and reads /proc info for each locally connected program, it allows you to match connections in real time, based on the additional attributes listed above.
All this amounts to a high degree of flexibility, which allows you to create some interesting traffic-shaping scenarios such as:
The available pyshaper commands are:
/etc/pyshaper/pyshaper.conf
/etc/pyshaper/pyshaper.conf.readme
/var/run/pyshaper.pid
Refer to pyshaper.conf(8), or the examples directory within the pyshaper distribution tarball.
New TCP connections will gain the 'default' bandwidth (as set in your configuration), until the next pyshaper connection scanning cycle, at which time they will be matched against your rules and shaped accordingly. This can cause momentary bursts of excess bandwidth consumption on the part of connections you want throttled. To work around this, be a little more conservative in your bandwidth allocations, and/or set a more frequent connection scanning interval.
pyshaper only manages TCP connections. At this time, it is not capable of managing UDP traffic.
pyshaper
was written by David McNab <david@freenet.org.nz>
Refer author's python repository at http://www.freenet.org.nz/python
pyshaper is released under the terms of the GNU General Public License (GPL). For more information on the GPL, refer to the GNU Website at http://gnu.org
tc(8)