Skip to content

Instantly share code, notes, and snippets.

@lyekumchew
Last active March 6, 2020 05:00
Show Gist options
  • Save lyekumchew/0c2b1efbb98fefb114d7d3a5365315f8 to your computer and use it in GitHub Desktop.
Save lyekumchew/0c2b1efbb98fefb114d7d3a5365315f8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# numactl -> /usr/bin//usr/bin/numactl
# iperf -> /usr/bin//usr/bin/iperf
# tcp server
# /usr/bin/numactl -N 0-3 /usr/bin/iperf -s
# udp server
# /usr/bin/numactl -N 0-3 /usr/bin/iperf -u -s
# client tcp usecases
function tcp_cases() {
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 \
-t 100 -i 1 -b 100g -w 400M -P 128 &> IP1.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 \
-t 100 -i 1 -b 100g -w 400M -P 128 &> IP2.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 \
-t 20 -b 100g -w 400M -P 1 &> IP3.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 \
-t 20 -b 100g -w 400M -P 32 &> IP4.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 \
-t 20 -b 100g -w 400M -P 64 &> IP5.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 \
-t 20 -b 100g -w 400M -P 96 &> IP6.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 \
-t 20 -b 100g -w 400M -P 128 &> IP7.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 \
-t 20 -b 100g -w 400M -P 128 -n 5000000000 &> IP8.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 -t 20 -i 1 -b 100g -w 100M -P 128 &> IP14.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 -t 20 -i 1 -b 100g -w 200M -P 128 &> IP15.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 -t 20 -i 1 -b 100g -w 1024M -P 128 &> IP16.log
}
# client udp usecases
function udp_cases() {
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 -u -b 1g -i 3 &> IP9.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 -u -b 5g -i 3 &> IP10.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 -u -b 10g -i 3 &> IP11.log
/usr/bin/numactl -N 0-3 /usr/bin/iperf -c 172.26.0.2 -u -b 100g -i 3 &> IP13.log
}
case $1 in
tcp)
echo "tcp usescase begin!"
tcp_cases
;;
udp)
echo "udp usescase begin!"
udp_cases
;;
*)
echo "pls use udp/tcp args"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment