[ovs-discuss] a suggestion to improve performance when adding lots of ports

Ben Pfaff blp at nicira.com
Tue Nov 25 15:40:09 UTC 2014


On Tue, Nov 25, 2014 at 05:36:31PM +0800, ychen wrote:
>    I have found that when adding lots of ports, system consumes more and more time when ports number increasing.
>   And the main time is consumed on encapsulation and decapsulation the JSON message between vsctl and ovsdb-server.
>   when vsctl starts, it will first send monitor request to ovsdb-server, and then db-server send all the records with the related column to vsctl
>   please notice the word "all records", so that when ports number gets larger, system will need more time to encap and decap the JSON message between vsctl and db-server.
> 
> 
>   I suggest to slightly modify the RPC  method "Monitor" in RFC 7047. The main idea is only monitor specified records when add /del/set/get port.
>   The original Monitor method is like that:
>   Each <monitor-request> is an object with the following members:
> "columns": [<column>*] optional
> "select": <monitor-select> optional
> The columns, if present, define the columns within the table to be
> monitored. <monitor-select> is an object with the following members:
> "initial": <boolean> optional
> "insert": <boolean> optional
> "delete": <boolean> optional
> 
> "modify": <boolean> optional
>   And I want give this method a slight change:
> <monitor-select> is an object with the following members:
> "initial": <boolean> optional
> "insert": <boolean> optional
> "delete": <boolean> optional
> 
> "modify": <boolean> optional
> "where": [<condition>*] optional
> for example, when add or del a port p0, first we will send a monitor request like this:
> method="monitor", params=["Open_vSwitch",null,{"Port":{"columns":["bridges","fake_bridge","interfaces","name","tag"],"select":{"where":[["name","==","p0"]]}},"Interface":{"columns":["name","ofport","type"],"select":{"where":[["name","==","p0"]]}},"Bridge":{"columns":["controller","fail_mode","name"],"select":{"where":[["name","==","br0"]]}},"Controller":{"columns":[]},"Open_vSwitch":{"columns":["bridges","cur_cfg"]}}]
> then ovsdb-server should only reply with the specified record p0, so that we can save lots of time when monitoring. 
> I have done a test with this method, with 4000 ports, the time consuming can be decreased from about 2800s to about 500s.

Sounds great, please submit patches when you have them ready.



More information about the discuss mailing list