Comment 11 for bug 1311804

Revision history for this message
Kevin Benton (kevinbenton) wrote :

Yes, but we don't know what is changing permissions in all cases. We are much better off here programming defensively rather than going for extreme optimization for something that isn't the hot path compared to security group processing, RPC calls, etc.

10k interfaces on one node is pretty unlikely, but even in that case processing 10,000 sudo calls added about 42 seconds to the whole process, which is definitely not going to be the bottleneck in creating that many interfaces simultaneously.

$ python
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import timeit
>>> timeit.timeit("import os; os.system('ip netns list')", number=10000)
15.637353897094727
>>> timeit.timeit("import os; os.system('sudo ip netns list')", number=10000)
57.93700289726257
>>>