Skip to content

Commit

Permalink
Perf/memleak (#1791)
Browse files Browse the repository at this point in the history
* perf: disable mlockall to reduce memory usage

mlockall will lock all virtual memory page into physic memory and prevent memory recycle.
With this option rss size reduced from 39M to 7M

* perf: fix memory leak
  • Loading branch information
oilbeater committed Aug 9, 2022
1 parent 225da25 commit 70f1b14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dist/images/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ RUN apt update && apt install build-essential git libnuma-dev autoconf curl \
RUN cd /usr/src/ && \
git clone -b ovn-22.03.1 --depth=1 https://github.com/kubeovn/ovs.git && \
cd ovs && \
# fix memleak
curl -s https://github.com/kubeovn/ovs/commit/2dc8e7aa202818952b2fa80b47298604530c9de0.patch | git apply && \
# increase election timer
curl -s https://github.com/kubeovn/ovs/commit/22ea22c40b46ee5adeae977ff6cfca81b3ff25d7.patch | git apply && \
# compile without avx512
Expand Down
2 changes: 1 addition & 1 deletion dist/images/start-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function exchange_link_names() {
exchange_link_names

# Start vswitchd. restart will automatically set/unset flow-restore-wait which is not what we want
/usr/share/openvswitch/scripts/ovs-ctl start --no-ovsdb-server --system-id=random
/usr/share/openvswitch/scripts/ovs-ctl start --no-ovsdb-server --system-id=random --no-mlockall
/usr/share/openvswitch/scripts/ovs-ctl --protocol=udp --dport=6081 enable-protocol

sleep 1
Expand Down

0 comments on commit 70f1b14

Please sign in to comment.