summaryrefslogtreecommitdiffstats
path: root/debloat.sh
diff options
context:
space:
mode:
authord. johnson <fenris02@fedoraproject.org>2014-10-01 01:13:14 -0500
committerd. johnson <fenris02@fedoraproject.org>2014-10-01 01:13:14 -0500
commita61a8ad5f2501614b667a23f1091b9734e0f9c48 (patch)
tree99597f185d748d6548de51d7476bb66fc3ca37d7 /debloat.sh
parentf59794a19d23e6b1724d841185f89328ab81993b (diff)
downloadcleanup-a61a8ad5f2501614b667a23f1091b9734e0f9c48.tar.gz
cleanup-a61a8ad5f2501614b667a23f1091b9734e0f9c48.tar.xz
cleanup-a61a8ad5f2501614b667a23f1091b9734e0f9c48.zip
re-pull debloat files from https://github.com/dtaht/deBloat/tree/master/src
Diffstat (limited to 'debloat.sh')
-rwxr-xr-xdebloat.sh21
1 files changed, 11 insertions, 10 deletions
diff --git a/debloat.sh b/debloat.sh
index 2c78a0b..e49a199 100755
--- a/debloat.sh
+++ b/debloat.sh
@@ -1,18 +1,20 @@
#!/bin/bash
-# debloat.sh - improves network latency by reducing excessive buffering
+# debloat.sh - improves network latency by reducing excessive buffering
# and offloads on common devices and enabling fq_codel.
# Copyright 2012 M D Taht. Released into the public domain.
-# This script is presently targetted to go into
+# This script is presently targetted to go into
# /etc/network/ifup.d on debian derived systems
+[[ "$IFACE" == "lo" ]] && exit 0
+
LL=1 # go for lowest latency
ECN=1 # enable ECN
BQLLIMIT100=3000 # at speeds below 100Mbit, 2 big packets is enough
-BQLLIMIT10=1514 # at speeds below 10Mbit, 1 big packet is enough.
+BQLLIMIT10=1514 # at speeds below 10Mbit, 1 big packet is enough.
# Actually it would be nice to go to just one packet
QDISC=fq_codel # There are multiple variants of fq_codel in testing
-FQ_LIMIT="" # the default 10000 packet limit mucks with slow start at speeds
+FQ_LIMIT="" # the default 10000 packet limit mucks with slow start at speeds
# at 1Gbit and below. Somewhat arbitrary figures selected.
[ -z "$IFACE" ] && echo error: $0 expects IFACE parameter in environment && exit 1
@@ -20,7 +22,7 @@ FQ_LIMIT="" # the default 10000 packet limit mucks with slow start at speeds
[ -z `which tc` ] && echo error: tc is required && exit 1
# FIXME see if $QDISC is available. modprobe?
-# BUGS - need to detect bridges.
+# BUGS - need to detect bridges.
# - Need filter to distribute across mq ethernet devices
# - needs an "undebloat" script for ifdown to restore BQL autotuning
@@ -55,7 +57,7 @@ et() {
# to be voice, video, best effort and background
wifi() {
- tc qdisc add dev $IFACE handle 1 root mq
+ tc qdisc add dev $IFACE handle 1 root mq
tc qdisc add dev $IFACE parent 1:1 $QDISC $FQ_OPTS noecn
tc qdisc add dev $IFACE parent 1:2 $QDISC $FQ_OPTS
tc qdisc add dev $IFACE parent 1:3 $QDISC $FQ_OPTS
@@ -67,7 +69,7 @@ wifi() {
mq() {
local I=1
- tc qdisc add dev $IFACE handle 1 root mq
+ tc qdisc add dev $IFACE handle 1 root mq
for i in $S/$IFACE/queues/tx-*
do
@@ -88,7 +90,7 @@ local SPEED=`cat $S/$IFACE/speed` 2> /dev/null
if [ -n "$SPEED" ]
then
[ "$SPEED" = 4294967295 ] && echo "no ethernet speed selected. debloat estimate will be WRONG"
- [ "$SPEED" -lt 1001 ] && FQ_LIMIT=1200
+ [ "$SPEED" -lt 1001 ] && FQ_LIMIT="limit 1200"
if [ "$SPEED" -lt 101 ]
then
[ $LL -eq 1 ] && et # for lowest latency disable offloads
@@ -107,7 +109,7 @@ fix_queues() {
local QUEUES=`ls -d $S/$IFACE/queues/tx-* | wc -l | awk '{print $1}'`
if [ $QUEUES -gt 1 ]
then
- if [ -x $S/$IFACE/phy80211 ]
+ if [ -x $S/$IFACE/phy80211 ]
then
wifi
else
@@ -124,4 +126,3 @@ fix_speed
fix_queues
exit 0
-