Since my router does not allow bandwidth limiting, I need the ability to limit some containers like Duplicati or Kopia.
Some applications limit bandwidth on average rather than setting hard limits, which can still lead to ping spikes.
It's relatively simple to configure an upload limit on WireGuard VPN containers by modifying the wg0.conf
PostUp = tc qdisc add dev wg0 parent root handle 1: hfsc default 1 && tc class add dev wg0 parent 1: classid 1:1 hfsc sc rate 20mbit ul rate 20mbit
Alternatively, by giving a custom name to the Docker network bridge, a bandwidth limit can also be applied to a group of containers using the User Script Plugin. Setting a shared bandwidth limit for a group of containers could be more efficient than applying a low limit to each of them.
# Download
tc qdisc add dev br-bwlimit parent root handle 1: hfsc default 1
tc class add dev br-bwlimit parent 1: classid 1:1 hfsc sc rate 10mbit ul rate 10mbit
# Upload
tc qdisc add dev br-bwlimit handle ffff: ingress
tc filter add dev br-bwlimit parent ffff: protocol ip prio 1 u32 match ip src 0.0.0.0/0 police rate 10mbit burst 10k drop flowid :1
Currently, Unraid does not include the required kernel modules, so I have compiled them and loaded them manually using insmod
Therefore, I am requesting the addition of the following modules to the kernel configuration:
CONFIG_NET_SCH_HTB=m
CONFIG_NET_SCH_HFSC=m
CONFIG_NET_CLS_U32=m
This would allow:
Limiting bandwidth for containers.
Applying limits to a Docker or WireGuard network.
Possibly also for VMs and LXC containers.
and spare me from compiling the modules for every Unraid update in the future 😅
Im currently using Unraid 7.0.0-beta.3