diff --git a/base-files-config/debian/deb_folder/base-files-config.dirs b/base-files-config/debian/deb_folder/base-files-config.dirs new file mode 100644 index 0000000..73bbb08 --- /dev/null +++ b/base-files-config/debian/deb_folder/base-files-config.dirs @@ -0,0 +1,5 @@ +etc/profile.d/ +etc/systemd/system/cron.service.d +etc/systemd/system/rsync.service.d +etc/vim +usr/share/starlingx/base-files diff --git a/base-files-config/debian/deb_folder/base-files-config.install b/base-files-config/debian/deb_folder/base-files-config.install index 413e216..29b14f9 100644 --- a/base-files-config/debian/deb_folder/base-files-config.install +++ b/base-files-config/debian/deb_folder/base-files-config.install @@ -1,5 +1,7 @@ -custom.sh /etc/profile.d/ -motd /usr/share/starlingx/base-files -profile /usr/share/starlingx/base-files -prompt.sh /etc/profile.d/ -vimrc.local /etc/vim/ +etc/profile.d/custom.sh +etc/profile.d/prompt.sh +etc/systemd/system/cron.service.d/cron-cpu-shares.conf +etc/systemd/system/rsync.service.d/rsync-cpu-shares.conf +etc/vim/vimrc.local +usr/share/starlingx/base-files/motd +usr/share/starlingx/base-files/profile diff --git a/base-files-config/debian/deb_folder/changelog b/base-files-config/debian/deb_folder/changelog index d2bd8f9..c48a038 100644 --- a/base-files-config/debian/deb_folder/changelog +++ b/base-files-config/debian/deb_folder/changelog @@ -1,3 +1,9 @@ +base-files-config (1.0-2) unstable; urgency=medium + + * Added systemd DropIn config overrides for cron.service, rsync.service + + -- Jim Gauld Thu, 21 Nov 2024 08:35:05 -0400 + base-files-config (1.0-1) unstable; urgency=medium * Initial release diff --git a/base-files-config/debian/deb_folder/copyright b/base-files-config/debian/deb_folder/copyright index f2af967..22b5dfa 100644 --- a/base-files-config/debian/deb_folder/copyright +++ b/base-files-config/debian/deb_folder/copyright @@ -3,7 +3,7 @@ Upstream-Name: base-files-config Source: https://opendev.org/starlingx/config-files/ Files: * -Copyright: (c) 2013-2021 Wind River Systems, Inc +Copyright: (c) 2013-2024 Wind River Systems, Inc License: Apache-2 Files: debian/* diff --git a/base-files-config/debian/deb_folder/rules b/base-files-config/debian/deb_folder/rules index f00dbc2..239d240 100644 --- a/base-files-config/debian/deb_folder/rules +++ b/base-files-config/debian/deb_folder/rules @@ -3,5 +3,17 @@ # output every command that modifies files on the build system. #export DH_VERBOSE = 1 +ROOT := $(CURDIR)/debian/tmp + %: dh $@ + +override_dh_install: + install -p -D -m 644 custom.sh ${ROOT}/etc/profile.d/custom.sh + install -p -D -m 644 prompt.sh ${ROOT}/etc/profile.d/prompt.sh + install -p -D -m 644 cron-cpu-shares.conf ${ROOT}/etc/systemd/system/cron.service.d/cron-cpu-shares.conf + install -p -D -m 644 rsync-cpu-shares.conf ${ROOT}/etc/systemd/system/rsync.service.d/rsync-cpu-shares.conf + install -p -D -m 644 vimrc.local ${ROOT}/etc/vim/vimrc.local + install -p -D -m 644 motd ${ROOT}/usr/share/starlingx/base-files/motd + install -p -D -m 644 profile ${ROOT}/usr/share/starlingx/base-files/profile + dh_install diff --git a/base-files-config/debian/meta_data.yaml b/base-files-config/debian/meta_data.yaml index db2094e..ac20678 100644 --- a/base-files-config/debian/meta_data.yaml +++ b/base-files-config/debian/meta_data.yaml @@ -1,6 +1,6 @@ --- debname: base-files-config -debver: 1.0-1 +debver: 1.0-2 src_path: source revision: dist: $STX_DIST diff --git a/base-files-config/source/cron-cpu-shares.conf b/base-files-config/source/cron-cpu-shares.conf new file mode 100644 index 0000000..635d67b --- /dev/null +++ b/base-files-config/source/cron-cpu-shares.conf @@ -0,0 +1,10 @@ +[Service] +# cgroup performance engineering +# - cron.service does not provide latency critical service +# - some cron jobs have significant significant sustained CPU and disk IO +# - set 1/8th default share +# - set lower IO priority (effective only with 'bfq' scheduler) +CPUShares=128 +Nice=19 +IOSchedulingClass=best-effort +IOSchedulingPriority=7 diff --git a/base-files-config/source/rsync-cpu-shares.conf b/base-files-config/source/rsync-cpu-shares.conf new file mode 100644 index 0000000..744f009 --- /dev/null +++ b/base-files-config/source/rsync-cpu-shares.conf @@ -0,0 +1,9 @@ +[Service] +# cgroup performance engineering +# - rsync.service does not provide latency critical service +# - set 1/8th default share +# - set lower IO priority (effective only with 'bfq' scheduler) +CPUShares=128 +Nice=19 +IOSchedulingClass=best-effort +IOSchedulingPriority=7 diff --git a/docker-config/source-debian/docker-stx-override.conf b/docker-config/source-debian/docker-stx-override.conf index 7633dff..bb8b49f 100644 --- a/docker-config/source-debian/docker-stx-override.conf +++ b/docker-config/source-debian/docker-stx-override.conf @@ -5,5 +5,17 @@ ExecStartPost=/bin/bash -c 'echo $MAINPID > /var/run/dockerd.pid;' ExecStartPost=/bin/bash -c 'sleep 2 && [ ! -d '/var/lib/docker/tmp' ] && /bin/systemctl restart docker.service || true' ExecStopPost=/bin/rm -f /var/run/dockerd.pid +# cgroup performance engineering +# - docker.service does not provide latency critical service +# - docker generates significant sustained CPU and disk IO writes +# - 'docker pull' and 'docker load' require many parallel dockerd threads; +# extraction phase has multiple 'docker-untar' and 'unpigz' processes +# - set 1/8th default share +# - set lower IO priority (effective only with 'bfq' scheduler) +CPUShares=128 +Nice=19 +IOSchedulingClass=best-effort +IOSchedulingPriority=7 + # pmond monitors docker service Restart=no diff --git a/openssh-config/source-debian/ssh.service b/openssh-config/source-debian/ssh.service index 0174c81..746869e 100644 --- a/openssh-config/source-debian/ssh.service +++ b/openssh-config/source-debian/ssh.service @@ -16,6 +16,19 @@ Type=notify RuntimeDirectory=sshd RuntimeDirectoryMode=0755 +# cgroup performance engineering +# - ssh (and tools run by users) do not provide latency critical service +# - specific tools can easily take 100% cpu and do significant IO +# - set 1/8th default share +# - set 100% cpu quota (1 logical cpu) +# - set lower IO priority (effective only with 'bfq' scheduler) +CPUShares=128 +CPUQuota=100% +CPUQuotaPeriodSec=10ms +Nice=19 +IOSchedulingClass=best-effort +IOSchedulingPriority=7 + [Install] WantedBy=multi-user.target Alias=sshd.service