I think that ovs-vsctl has an internal O(n**2) problem for that kind of usage. Probably, it could be fixed if anyone wanted to take the time.
On Wed, Jul 06, 2016 at 01:24:56PM +0530, Kapil Adhikesavalu wrote: > When I tried, I used a single ovs-vsctl with all the patch ports as > arguments. > > It was taking around 25 to 30 seconds for creating 5000 patch ports. > > Thanks > Kapil > On 06-Jul-2016 5:29 AM, "Justin Pettit" <jpet...@ovn.org> wrote: > > > > > > On Jul 4, 2016, at 4:50 AM, Levente Csikor <csi...@tmit.bme.hu> wrote: > > > > > > Hi, > > > > > > I did not find any documented limit about the number of patchports, so I > > wrote a simple script, which adds a predefined number of patchports and > > some dummy rules into the flow tables to actually have some reason for the > > whole stuff. > > > > > > First, I tried to add 100 and 1000 patchports between two OVS bridges. > > It was feasible, but took some time. > > > Then I tried with 10000 patchports, but I couldn't wait until it > > finished. After 1000 patchports, the adding procedure became slower and > > slower, so I killed the whole process (after a couple of thousands > > patchports the time OVS required for setting up one patchport was around a > > couple of seconds). > > > > This would be surprising to me. How did you add the ports? If you just > > ran a bunch of ovs-vsctl commands, it can take that long, but it shouldn't > > if you add them in a single transaction. From the FAQ: > > > > -=-=-=-=-=-=-=-=-=- > > > > Q: I want to add thousands of ports to an Open vSwitch bridge, but > > it takes too long (minutes or hours) to do it with ovs-vsctl. How > > can I do it faster? > > > > A: If you add them one at a time with ovs-vsctl, it can take a long > > time to add thousands of ports to an Open vSwitch bridge. This is > > because every invocation of ovs-vsctl first reads the current > > configuration from OVSDB. As the number of ports grows, this > > starts to take an appreciable amount of time, and when it is > > repeated thousands of times the total time becomes significant. > > > > The solution is to add the ports in one invocation of ovs-vsctl (or > > a small number of them). For example, using bash: > > > > ovs-vsctl add-br br0 > > cmds=; for i in {1..5000}; do cmds+=" -- add-port br0 p$i"; done > > ovs-vsctl $cmds > > > > takes seconds, not minutes or hours, in the OVS sandbox environment. > > -=-=-=-=-=-=-=-=-=- > > > > --Justin > > > > > > _______________________________________________ > > discuss mailing list > > discuss@openvswitch.org > > http://openvswitch.org/mailman/listinfo/discuss > > > _______________________________________________ > discuss mailing list > discuss@openvswitch.org > http://openvswitch.org/mailman/listinfo/discuss _______________________________________________ discuss mailing list discuss@openvswitch.org http://openvswitch.org/mailman/listinfo/discuss