[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACP96tRWO+zpQ0OgeOzuA9A==rKSnzS+s7mJBAiCv=vb703LWQ@mail.gmail.com>
Date: Wed, 28 May 2014 07:54:36 -0400
From: sowmini varadhan <sowmini05@...il.com>
To: Jamal Hadi Salim <jhs@...atatu.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
Niels Möller <nisse@...thpole.se>,
netdev <netdev@...r.kernel.org>, Jonas Bonn <jonas@...thpole.se>
Subject: Re: Scaling 'ip addr add' (was Re: What's the right way to use a
*large* number of source addresses?)
On Wed, May 28, 2014 at 7:23 AM, Jamal Hadi Salim <jhs@...atatu.com> wrote:
>
> Did you try the scenario where you add many IP addresses to the same
> interface? Try to do a listing of the ip addresses then, should be
> fun.
I did. Here, you try it too :-) attached below is the script I got from Niels.
And yes, while it is "fun" to do "ip addr show dev $IF|grep '\<inet\>'|wc -l",
I think Niels is first trying to scale the address-addition itself first
BTW, I'm not sure it's O(n^2) - we dont have enough data points from
the script below to establish that. Once you optimize fib_sync_up,
I suspect it scales as K * n, where N > 1. FWIW, doing the quick+dirty
thing of just commenting out fib_sync_up as an experiment *halves* the
wallclock time.
$ cat nils.sh
#!/bin/sh
#
# From nisse@...thpole.se (Niels Moller)
# I used the below script. Run, e.g, with arguments
# eth0 100 add
# to assign 100*255 addresses..
# And to get numbers, I just ran it with time(1).
if [ $# -lt 2 ] ; then
echo Too few arguments
exit 1
fi
IF=$1
CNT=$2
if [ $# -gt 2 ] ; then
CMD=$3
else
CMD=del
fi
echo "IF $IF CNT $CNT CMD $CMD"
for x in `seq 1 $CNT` ; do
echo 10.200.$x.x
for y in `seq 1 255` ; do
addr="10.200.$x.$y"
ip address "$CMD" "$addr"/32 dev "$IF" || echo FAIL: $addr
done
done
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists