Skip to content

Instantly share code, notes, and snippets.

@Stantheman
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Stantheman/029d4817bdd94e14e4e1 to your computer and use it in GitHub Desktop.
Save Stantheman/029d4817bdd94e14e4e1 to your computer and use it in GitHub Desktop.
#!/bin/bash
choose_congestion_control="/proc/sys/net/ipv4/tcp_congestion_control"
ip=127.0.0.1
iperf -s
iperf_pid=$!
for i in $(ls /lib/modules/3.2.0-4-amd64/kernel/net/ipv4/tcp*); do
# transform the path from /lib/.../tcp_bic.ko to bic
kernelname=${i##*/}
kernelname=${kernelname##tcp_}
kernelname=${kernelname%%.ko}
if [[ "$kernelname" == "diag" ]]; then
echo skipping
continue
fi
echo "testing $kernelname"
# iperf will set on the socket, otherwise I'd need:
# echo $kernelname > $choose_congestion_control
iperf -t5 -c $ip -Z $kernelname | tee $kernelname.txt
done
# since cubic is built-in, do that too
echo "testing cubic"
#echo cubic > $choose_congestion_control
iperf -t5 -c $ip -Z cubic | tee cubic.txt
kill $iperf_pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment