openvswitch / ovs-issues

Issue tracker repo for Open vSwitch
10 stars 3 forks source link

Consider ovsdb relay model to support memory trimming #311

Open gujun4990 opened 8 months ago

gujun4990 commented 8 months ago

Environment

ovs version: branch-2.16.2

Description

nb and nb-relay run in our environment, we found that they occupy amount of memory as below. 1

So we enable memory trimming to return unused memory to OS using below commands:

ovs-appctl -t /var/run/ovn/ovnnb_db.ctl ovsdb-server/memory-trim-on-compaction on
ovs-appctl -t /var/run/ovn/ovnnb_db.ctl ovsdb-server/compact

After that we can see that memory is down a lot as below. 2

But after a flew days, nb occupy amount of memory again as below. 3

After analyzing ovs code, we found that memory trimming will be executed when running ovsdb snapshot operation. Because relay model wouldn't run snapshot operation, so nb-relay wouldn't execute memory trimming even that it is enabled except that run ovsdb-server/compact command manually. So whether we also need to consider ovsdb relay model to support memory trimming?