Configure systemd CPUShares for sm and sm-api services

sm service and sm-api service CPUShares are reduced to 512 out of 1024
since they exhibit severe CPU hog behaviour for extended periods
particularly during host configuration.

NOTE: CPUQuota may not be used for these services because they require
more than number of Platform CPUs during host configuration.

This is part of an overall set of adjustments are required for systemd
cgroups CPUShares, CPUQuota, and AllowedCPUs for key system services.
This will improve latency of Kubernetes critical components, and
throttles lesser important services.

Partial-Bug: 2084714

TEST PLAN:
AIO-SX, AIO-DX, Standard, Storage, DC:
- PASS: Fresh install
- PASS: verify systemd parameters for sm and sm-api
  Example:
    systemctl show sm.service | grep -e CPUShares
    systemctl show sm-api.service | grep -e CPUShares

AIO-SX, AIO-DX:
- PASS: BnR
- PASS: K8S orchestrated Upgrade 1.24 - 1.29

Change-Id: If72dd952aec5331db8146caefe8441b96475211d
Signed-off-by: Jim Gauld <James.Gauld@windriver.com>
This commit is contained in:
Jim Gauld 2024-11-15 03:16:25 -05:00
parent 69c47ef5b8
commit 348021f752
2 changed files with 6 additions and 0 deletions
service-mgmt-api/sm-api/scripts
service-mgmt/sm/scripts

@ -11,5 +11,8 @@ ExecStart=/etc/init.d/sm-api start
ExecStop=/etc/init.d/sm-api stop
PIDFile=/var/run/sm-api.pid
# cgroup engineering
CPUShares=512
[Install]
WantedBy=multi-user.target

@ -15,5 +15,8 @@ RestartSec=10
Restart=on-failure
LimitNOFILE=1024
# cgroup engineering
CPUShares=512
[Install]
WantedBy=multi-user.target