Skip to main content

NetLimiter-like traffic shaping for Linux

Project description


NetLimiter-like traffic shaping for Linux


TrafficToll allows you to limit download and upload bandwidth globally (per interface) and per process, even during the process' runtime.

The configuration can be easily adjusted and new limits applied at any point, as opposed to similar tools which either can only apply fixed global limits to the interface, certain ports, or require you to start the process through them (and thus restart the target process to change the limits).


# tt device config

Where device is the interface you want to limit (usually the one you connect to the internet with). For example:

  • # tt enp3s0 night.yaml --delay 0.5 (regular interface, check every half second for change in networked processes)
  • # tt tun0 day.yaml --logging-level DEBUG (VPN interface, adjust logging level to DEBUG)

Currently TrafficToll works based on a YAML configuration file. The configuration file is best explained by example:

# Global limits
download: 500kbps
upload: 100kbps

# Matched process limits
    download: 100kbps
      - exe: /opt/vivaldi/vivaldi-bin

    download: 300kbps

    # This won't work, the specified upload exceeds the global upload, it will
    # be 100kb/s max
    upload: 200kbps
      - exe: /opt/discord/Discord

  JDownloader 2:
    # JDownloader 2 obviously has its own traffic shaping, this is just here as
    # an example to show that matching on something else than the executable's
    # path is possible
    download: 300kbps
      - cmdline: .* JDownloader.jar

Units can be specified in all formats that tc supports, namely: bit (with and without suffix), kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps. To specify in IEC units, replace the SI prefix (k-, m-, g-, t-) with IEC prefix (ki-, mi-, gi- and ti-) respectively.

All limits can be omitted, in which case obviously no limiting will be applied. A process is selected when all predicates in the match section match. Every attribute psutil.Process provides on Linux can be matched on, using regular expressions.

When you terminate tt using Ctrl+C all changes to the traffic scheduling will be reverted, allowing you to easily update the config and apply new limits.


$ pip install traffictoll

tt has to be run as root.


Because a picture is always nice, even for CLI applications:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TrafficToll-1.0.2.tar.gz (32.1 kB view hashes)

Uploaded source

Built Distribution

TrafficToll-1.0.2-py3-none-any.whl (33.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page