Bug 1843874

Summary: [RFE] ovsdb-server: Explore memory consumption reduction by shrinking unused space in hash maps
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Ilya Maximets <i.maximets>
Component: OVNAssignee: OVN Team <ovnteam>
Status: NEW --- QA Contact: Jianlin Shi <jishi>
Severity: medium Docs Contact:
Priority: medium    
Version: FDP 20.CCC: ctrautma
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ilya Maximets 2020-06-04 11:10:23 UTC
ovsdb-server uses a lot of hash maps, but it never actually calls
hmap_shrink().  For example, if we will create a lot of logical switches
and ports for some special case and than remove all of them, ovsdb-server
will not return consumed memory to the system.

We need to explore how much memory we could save in such case and actually
shrink hash maps if needed.  'table->rows' might be a good candidate.

For the reference, concurrent hash maps in OVS (cmap) shrinks automatically if
memory usage is below than 20% of allocated space.  We might consider similar
approach.