[Bloat] Best practices for paced TCP on Linux?

Eric Dumazet eric.dumazet at gmail.com
Sat Apr 7 11:08:47 EDT 2012


Le samedi 07 avril 2012 à 00:21 +0200, Steinar H. Gunderson a écrit :

> I'll be perfectly happy just doing _something_; I don't need a perfect
> solution. We have one more night of streaming, and then the event is over. :-)
> 
> /* Steinar */

OK its probably too late :)

Here is a script I would use/adapt somehow...
(You probably need 1024 subclasses, this script uses 256 slots only)

ETH=eth7
NUMGROUPS=256
RATE="rate 5Mbit"
ALLOT="allot 4000"

MASK=$(($NUMGROUPS-1))
HMASK=$(printf %02x $MASK)
LIST=`seq 0 $MASK`

TC="tc"
export PATH=/sbin:/usr/sbin:$PATH

# Not sure 10Gbit can be reached without TSO...
#ethtool -K $ETH tso off

$TC qdisc del dev $ETH root 2>/dev/null


$TC qdisc add dev $ETH root handle 1: est 0.5sec 4sec cbq avpkt 1200 rate 10Gbit \
	bandwidth 10Gbit
$TC class add dev $ETH parent 1: classid 1:1 \
	est 0.5sec 4sec cbq allot 8000 mpu 64 \
	rate 10Gbit prio 1 avpkt 1200 bounded

$TC filter add dev $ETH parent 1: protocol ip  prio 10 u32

$TC filter add dev $ETH parent 1: protocol ip prio 10 handle 8: u32 divisor $NUMGROUPS

for i in $LIST
do
  slot=$(printf %02x $(($i+16)))
  hexa=$(printf %02x $i)
  $TC class add dev $ETH parent 1:1 classid 1:$slot \
               est 0.5sec 4sec cbq $ALLOT mpu 64 $RATE prio 2 avpkt 1200 bounded
  $TC qdisc add dev $ETH parent 1:$slot handle $slot: est 0.5sec 4sec sfq limit 64
  $TC filter add dev $ETH parent 1: protocol ip prio 100 u32 ht 8:$hexa: \
	match ip dport 0x$hexa 0x$HMASK  flowid 1:$slot

done


$TC filter add dev $ETH parent 1: protocol ip prio 100 u32 \
		ht 800:: \
		match ip src 172.24.24.252 \
		match ip protocol 6 0xff \
		hashkey mask 0x$HMASK at 20 \
		link 8:

$TC filter add dev $ETH parent 1: protocol ip prio 100 u32 \
	match ip protocol 0 0x00 flowid 1:1





More information about the Bloat mailing list