Re: [RFC][PATCH] iproute: Faster ip link add, set and delete
From: Eric Dumazet <hidden>
Date: 2013-03-29 00:44:00
On Thu, 2013-03-28 at 17:25 -0700, Eric W. Biederman wrote:
Eric Dumazet [off-list ref] writes:quoted
On Thu, 2013-03-28 at 16:52 -0700, Eric W. Biederman wrote:quoted
On my microbenchmark of just creating 5000 veth pairs this takes pairs 16s instead of 13s of my earlier hacks but that is well down in the usable range.I guess most of the time is taken by sysctl_check_table()All of the significant sysctl slowdowns were fixed in 3.4. If you see something of sysctl show up in a trace I would be happy to talk about it. The kernel side seems to be creating N network devices seems to take NlogN time now. Both sysfs and sysctl store directories as rbtrees removing their previous bottlenecks. The loop I timed at 16s was just: time for i in $(seq 1 5000) ; do ip link add a$i type veth peer name b$i; done There is plenty of room for inefficiencies in 10000 network devices and 5000 forks+execs.
Ah right, the sysctl part is fixed ;) In batch mode, I can create these veth pairs in 4 seconds for i in $(seq 1 5000) ; do echo link add a$i type veth peer name b$i; done | ip -batch -