Skip to content

Instantly share code, notes, and snippets.

@rraallvv
Created November 10, 2018 21:23
Show Gist options
  • Save rraallvv/bd4a0390586f0c9c076b72fb818fb4be to your computer and use it in GitHub Desktop.
Save rraallvv/bd4a0390586f0c9c076b72fb818fb4be to your computer and use it in GitHub Desktop.
Traffic Controller Limit
# clear limit
sudo tc qdisc del dev eth0 root
# add limit
cgcreate -g net_cls:slow
echo 0x10001 > /sys/fs/cgroup/net_cls/slow/net_cls.classid
cgclassify -g net_cls:slow <pid of the process you want to limit>
tc qdisc add dev eth0 root handle 1: htb
tc filter add dev eth0 parent 1: handle 1: cgroup
tc class add dev eth0 parent 1: classid 1:1 htb rate 1mbps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment