[ovs-discuss] ovs-ofctl memory consumption is large compared to flow bundle size [formatting correction]

Michael Ben-Ami mbenami at digitalocean.com
Mon Mar 12 19:47:16 UTC 2018


Hello all,

We found that when we add a flow bundle of about 25MB of textual flows,
ovs-ofctl ballooned in resident memory to around 563MB. Similarly for a
bundle about half the size at 12.4MB, ovs-ofctl hit 285MB.

We've attached environment and reproduction details below, including a link
to the actual flows we used to test with in the 25MB case.

While we did notice that the area of flow handling had some improvements in
memory management (e.g. [1]), we wonder whether there is more work in
progress or potential for regression in this area.

On the other end, we wonder if there are other ways in which flows can be
summarized from the user perspective so that calling ovs-ofctl does not
result in such a heavyweight memory footprint (albeit temporary).

We’ve also done some profiling and included the results below. Any advice
on other profiling tools or techniques would also be appreciated.

Thanks for your time,
Michael


-- Environment --

# ovs-ofctl --version
ovs-ofctl (Open vSwitch) 2.7.3
OpenFlow versions 0x1:0x4

# ovsdb-server --version
ovsdb-server (Open vSwitch) 2.7.3

# uname -a
Linux <redacted> 4.9.77-1-generic #4+1516907002do~691dc34 SMP Thu Jan 25
19:04:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

-- Reproduction --

You can download the sample file we tested with directly through wget.
Opening in a browser might make the browser hang.

# wget
https://gist.githubusercontent.com/mdlayher/4a837a501a898f17615bf3841667e772/raw/90b17b40621db5589f32c7fd3f6e16ceffb41bbb/tunnel_flows.txt

# ls -al tunnel_flows.txt
-rw-r--r-- 1 root root 24870584 Mar 12 18:23 tunnel_flows.txt

# cat tunnel_flows.txt | /usr/bin/time -v ovs-ofctl --bundle add-flow
--flow-format=OXM-OpenFlow14 --protocols=OpenFlow14 br0 -
Command being timed: "ovs-ofctl --bundle add-flow
--flow-format=OXM-OpenFlow14 --protocols=OpenFlow14 br0 -"
User time (seconds): 1.44
System time (seconds): 0.33
Percent of CPU this job got: 35%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.03
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 563412
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 14236
Voluntary context switches: 511
Involuntary context switches: 2
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

-- Profiling --

#cat tunnel_flows.txt | valgrind --tool=exp-dhat ovs-ofctl --bundle
add-flow --flow-format=OXM-OpenFlow14 --protocols=OpenFlow14 br0 -
2>valgrind.out

<truncated output>
==27766== -------------------- 1 of 10 --------------------
==27766== max-live:    872,415,232 in 1 blocks
==27766== tot-alloc:   872,415,232 in 1 blocks (avg size 872415232.00)
==27766== deaths:      1, at avg age 6,224,041,622 (99.98% of prog lifetime)
==27766== acc-ratios:  0.67 rd, 0.62 wr  (591,370,685 b-read, 546,028,291
b-written)
==27766==    at 0x4C28EF0: malloc (in
/usr/lib/valgrind/vgpreload_exp-dhat-amd64-linux.so)
==27766==    by 0x4C2B28F: realloc (in
/usr/lib/valgrind/vgpreload_exp-dhat-amd64-linux.so)
==27766==    by 0x51C8F44: xrealloc (in
/usr/lib/libopenvswitch-2.7.so.1.0.3)
==27766==    by 0x5177CB4: parse_ofp_flow_mod_file (in
/usr/lib/libopenvswitch-2.7.so.1.0.3)
==27766==    by 0x40D1AB: ??? (in /usr/bin/ovs-ofctl)
==27766==    by 0x40D2DA: ??? (in /usr/bin/ovs-ofctl)
==27766==    by 0x5112CD6: ??? (in /usr/lib/libopenvswitch-2.7.so.1.0.3)
==27766==    by 0x406C6B: ??? (in /usr/bin/ovs-ofctl)
==27766==    by 0x56EEF44: (below main) (libc-start.c:287)

[1]
https://github.com/openvswitch/ovs/commit/5bacd5cdd6318306fb34dc42d1bd848eba19f551
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20180312/6bf63daa/attachment.html>


More information about the discuss mailing list