Re: Testing interface removal speedup patches from Eric Dumazet.
From: Alex Bligh <hidden>
Date: 2011-05-09 20:24:21
Ben, --On 9 May 2011 12:42:39 -0700 Ben Greear [off-list ref] wrote:
I use HZ of 1000, btw. I killed udev, haldaemon..seemed to be just my stuff running. I don't see any 'ifup' running with these things dead... If you want to post your script, I can run it on my machine...
See below - run (on ubuntu) by
service udev stop
unshare -n bash
./ifseq -n 500
The unshare seems sufficient to stop any remaining udev listeners getting
wind of interface creation/deletion.
--
Alex Bligh
#!/bin/bash
# Usage:
# ifaceseq [options]
#
# Options:
# -n NUM : use NUM interfaces
# -t TYPE : use TYPE of interfaces (supported: veth, vlan)
numifs=10
itype=veth
while getopts n:t: flag; do
case ${flag} in
n) numifs=${OPTARG} ;;
t) itype=${OPTARG} ;;
esac
done
shift $((OPTIND-1))
createifs ()
{
echo `date` creating $numifs interfaces
case ${itype} in
vlan)
for i in `seq 1 $numifs` ; do
ip link add link eth0 name vlan${i} type vlan id ${i}
done
;;
*)
for i in `seq 1 $numifs` ; do
ip link add testa${i} type veth peer name testb${i}
done
esac
echo `date` done
}
deleteifs ()
{
echo `date` deleting $numifs interfaces
case ${itype} in
vlan)
for i in `seq 1 $numifs` ; do
ip link delete dev vlan${i}
done
;;
*)
for i in `seq 1 $numifs` ; do
ip link delete testa${i}
done
esac
echo `date` done
}
time createifs;
time deleteifs;