2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 01:51:26 +00:00

ovs-ctl: Allow to set oom-score for ovs daemons.

Allow to set oom-score with --oom-score argument.
This argument can be set in ovs config file.
In rhel can set OPTIONS in /etc/sysconfig/openvswitch.
In debian can set OVS_CTL_OPTS in /etc/default/openvswitch-switch.

Acked-by: Eli Britstein <elibr@nvidia.com>
Acked-by: Simon Horman <horms@ovn.org>
Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
This commit is contained in:
Roi Dayan 2025-01-21 12:41:39 +02:00 committed by Eelco Chaudron
parent ae8dafe6b0
commit ad59bb8514
4 changed files with 14 additions and 0 deletions

View File

@ -194,6 +194,11 @@ The following options are less important:
place, because, perhaps, OVSDB manager is running on the same host
as OVS and share similar attack vectors.
* ``--oom-score=<score>``
Sets the Linux Out-Of-Memory (OOM) killer score for the OVS daemon
after it's been started.
* ``--ovsdb-server-priority=<niceness>`` or
``--ovs-vswitchd-priority=<niceness>``

3
NEWS
View File

@ -2,6 +2,9 @@ Post-v3.5.0
--------------------
- DPDK:
* New debug appctl command 'dpdk/get-memzone-stats'.
- ovs-ctl:
* Added a new option, --oom-score=<score>, to set the daemons' Linux
Out-Of-Memory (OOM) killer score.
v3.5.0 - xx xxx xxxx

View File

@ -356,6 +356,7 @@ set_defaults () {
OVS_MONITOR_IPSEC_OPTIONS=
OVSDB_SERVER_UMASK=
OVS_VSWITCHD_UMASK=
OOM_SCORE=
DB_FILE=$dbdir/conf.db
DB_SOCK=$rundir/db.sock
@ -448,6 +449,7 @@ Less important options for "start", "restart" and "force-reload-kmod":
--no-full-hostname set short hostname instead of full hostname
--no-record-hostname do not attempt to determine/record system
hostname as part of start command
--oom-score=SCORE Set oom-score after starting ovs daemon.
Debugging options for "start", "restart" and "force-reload-kmod":
--ovsdb-server-wrapper=WRAPPER

View File

@ -236,6 +236,10 @@ start_daemon () {
umask "$previuos_umask_value"
fi
if test X"$OOM_SCORE" != X; then
echo "$OOM_SCORE" > /proc/`cat $rundir/$daemon.pid`/oom_score_adj 2>/dev/null
fi
if test X"$strace" != X; then
# Strace doesn't have the -D option so we attach after the fact.
setsid $strace -o "$logdir/$daemon.strace.log" \