Using Linux tc to limit the outgoing bandwidth of a web server
6 points
1/21/1970
15 hours ago
by LorenDB
Comments
Bender
I use something similar and found it to balance traffic among people evenly mostly and that is sch_cake. Turns out it isn't just for home routers and works well on low traffic servers meaning I dont have like 30k+ concurrent active downloads.
The server is allowed 6tb/s but I don't want it to use all that. I lower to rtt to somewhere between 60ms and 80ms depending where I create the VM to optimize for the US. Default is 100ms.
The same can be applied to inbound traffic if one so desires, just makes tcpdump messy if I use -i any.
modprobe ifb numifbs=1 && ip link set dev ifb0 up
tc filter add dev eth0 parent ffff: protocol ip u32 match u32 0 0 action mirred egress redirect dev ifb0 2>/dev/null
tc qdisc add dev ifb0 root handle 1: cake bandwidth 200mbit besteffort rtt 80ms nonat triple-isolate split-gso 2>/dev/null
I use something similar and found it to balance traffic among people evenly mostly and that is sch_cake. Turns out it isn't just for home routers and works well on low traffic servers meaning I dont have like 30k+ concurrent active downloads.
The server is allowed 6tb/s but I don't want it to use all that. I lower to rtt to somewhere between 60ms and 80ms depending where I create the VM to optimize for the US. Default is 100ms.The same can be applied to inbound traffic if one so desires, just makes tcpdump messy if I use -i any.