On 5-2-2011 2:15, Ted Unangst wrote:
> On Fri, Feb 4, 2011 at 7:21 AM, Camiel Dobbelaar <c...@sentia.nl> wrote:
>> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
>>                # bring carp interfaces down gracefully
>> -               ifconfig | while read a b; do
>> +               ifconfig carp | while read a b; do
> 
> going back to the original issue, does "ifconfig | grep carp | while
> read a b" make things faster?

No, it's ifconfig itself that takes long.

With 2000 vlan interfaces and 1 carp interface:
# time ifconfig | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    1m11.29s real     0m12.07s user     0m59.03s system
# time ifconfig carp | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.06s real     0m0.01s user     0m0.05s system

1000
# time ifconfig | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m16.66s real     0m2.88s user     0m13.72s system
# time ifconfig carp | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.03s real     0m0.00s user     0m0.02s system

500
# time ifconfig | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m3.18s real     0m0.67s user     0m2.49s system
# time ifconfig carp | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.02s real     0m0.00s user     0m0.01s system

200
# time ifconfig | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.35s real     0m0.07s user     0m0.27s system
# time ifconfig carp | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.01s real     0m0.00s user     0m0.00s system


It does not scale linearly, but the real world usage (200) is fine.  I
think we can drop the diff, since it turned out not to be so obvious and
clean...

--
Cam

Reply via email to