update/sw-patch/bin/sw-patch-agent.service
Jim Gauld 362597b0fb Configure systemd CPUShares/Nice/IOScheduler for software and sw-patching
This updates CPUShares, Nice, and IOScheduler for:
- software: software-controller-daemon.service;
  several processes are 100% cpu hog and use significant disk IO
  (eg, sysinv-app, system CLI, ansible-playbooks)

- software: software.service;
  several processes are 100% cpu hog, and/or use significant disk IO
  (eg, /usr/bin/software-agent, ostree)

- sw-patch: sw-patch-agent.service;
  ostree pull, ostree admin processes are 100% cpu hog;
  these do significant disk read and write IO

- sw-patch: sw-patch-controller-daemon.service;
  /usr/sbin/sw-patch-controller-daemon is 100% cpu hog,
  and does significant disk write IO

This gives 1/8th reduced CPUShares, reduced Nice, and reduced
IOScheduler priority since these services have substantial CPU
and disk IO load, yet are not latency critical.

This is part of an overall set of adjustments are required for systemd
cgroups CPUShares, CPUQuota, and AllowedCPUs for 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 updated software and sw-patch services

- TODO: Platform USM Upgrade

  Example:
  systemctl show software-controller-daemon.service | \
    grep -e CPUShares -e CPUQuota -e Nice -e IOScheduling
  systemctl show software.service | \
    grep -e CPUShares -e CPUQuota -e Nice -e IOScheduling
  systemctl show sw-patch-agent.service | \
    grep -e CPUShares -e CPUQuota -e Nice -e IOScheduling
  systemctl show sw-patch-controller-daemon.service | \
    grep -e CPUShares -e CPUQuota -e Nice -e IOScheduling

Change-Id: Iee104d0487f3bd7a02bd1d6c833b30f7e605ecd4
Signed-off-by: Jim Gauld <James.Gauld@windriver.com>
2024-11-15 03:39:41 -05:00

28 lines
738 B
Desktop File

[Unit]
Description=StarlingX Patching Agent
After=syslog.target network-online.target sw-patch.service
Before=pmon.service
[Service]
Type=forking
User=root
ExecStart=/etc/init.d/sw-patch-agent start
ExecStop=/etc/init.d/sw-patch-agent stop
ExecReload=/etc/init.d/sw-patch-agent restart
PIDFile=/var/run/sw-patch-agent.pid
# cgroup performance engineering
# - sw-patch-agent.service does not provide latency critical service
# - ostree pull, ostree admin processes are 100% cpu hog;
# these do significant disk read and write IO
# - set 1/8th default share
# - set lower IO priority (effective only with 'bfq' scheduler)
CPUShares=128
Nice=19
IOSchedulingClass=best-effort
IOSchedulingPriority=7
[Install]
WantedBy=multi-user.target