Skip to content

Commit

Permalink
Apply memory limit for openqa-worker services
Browse files Browse the repository at this point in the history
All workers are already part of openqa-worker.slice, apply memory limit
to that slice to ensure that memory cannot be exhausted exclusively by
workers.

Reference: https://progress.opensuse.org/issues/133511
  • Loading branch information
baierjan committed Oct 6, 2023
1 parent d04a2c8 commit 858bf7a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ install-generic:
install -d -m 755 "$(DESTDIR)"/usr/lib/systemd/system
install -d -m 755 "$(DESTDIR)"/usr/lib/systemd/system-generators
install -d -m 755 "$(DESTDIR)"/usr/lib/tmpfiles.d
for i in systemd/*.{service,target,timer,path}; do \
for i in systemd/*.{service,slice,target,timer,path}; do \
install -m 644 $$i "$(DESTDIR)"/usr/lib/systemd/system ;\
done
ln -s [email protected] "$(DESTDIR)"/usr/lib/systemd/system/[email protected]
Expand Down
1 change: 1 addition & 0 deletions dist/rpm/openQA.spec
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ fi
%dir %{_unitdir}
%{_systemdgeneratordir}
%{_unitdir}/openqa-worker.target
%{_unitdir}/openqa-worker.slice
%{_unitdir}/[email protected]
%{_unitdir}/[email protected]
%{_unitdir}/openqa-worker-cacheservice-minion.service
Expand Down
7 changes: 7 additions & 0 deletions systemd/openqa-worker.slice
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=Slice for openqa-worker units

[Slice]
# Apply memory limit to this slice to ensure that memory cannot be exhausted
# exclusively by openqa-worker services.
MemoryMax=90%

0 comments on commit 858bf7a

Please sign in to comment.