diff options
author | Flavio Leitner <fbl@sysclose.org> | 2019-02-28 13:13:57 -0300 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-02-28 11:29:21 -0800 |
commit | b82a90e266e1246fe2973db97c95df22558174ea (patch) | |
tree | a8f9e3b2469dc93cbb6c0c88b4877035ffd22953 /rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | |
parent | cadfff1e9c791bbb66dff494130eddf2333e15f9 (diff) | |
download | openvswitch-b82a90e266e1246fe2973db97c95df22558174ea.tar.gz |
rhel: limit stack size to 2M.
The default stack size in Fedora/RHEL is 8M, which means when ovs-vswitchd
daemon starts and uses --mlockall (default), it will dirty all memory
regions for all threads which is proportionally to the number of CPUs.
On a big host this increases memory usage to many hundreds of megabytes
while OVS actually requires much less.
This patch relies on systemd to limit to 2M/thread. That is much more
than the minimum documented at function ovs_thread_create():
/* Some small systems use a default stack size as small as 80 kB, but OVS
* requires approximately 384 kB according to the following analysis:
* https://mail.openvswitch.org/pipermail/ovs-dev/2016-January/308592.html
*
* We use 512 kB to give us some margin of error. */
Acked-By: Timothy Redaelli <tredaelli@redhat.com>
Tested-By: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'rhel/usr_lib_systemd_system_ovs-vswitchd.service.in')
-rw-r--r-- | rhel/usr_lib_systemd_system_ovs-vswitchd.service.in | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in index 525deae0b..317aa993c 100644 --- a/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in +++ b/rhel/usr_lib_systemd_system_ovs-vswitchd.service.in @@ -14,6 +14,7 @@ Environment=XDG_RUNTIME_DIR=/var/run/openvswitch EnvironmentFile=/etc/openvswitch/default.conf EnvironmentFile=-/etc/sysconfig/openvswitch EnvironmentFile=-/run/openvswitch/useropts +LimitSTACK=2M @begin_dpdk@ ExecStartPre=-/bin/sh -c '/usr/bin/chown :$${OVS_USER_ID##*:} /dev/hugepages' ExecStartPre=-/usr/bin/chmod 0775 /dev/hugepages |