Skip to content

Commit

Permalink
OF-2526: SystemD: limit resources and add openfire.slice
Browse files Browse the repository at this point in the history
  • Loading branch information
stokito authored and Fishbowler committed Nov 1, 2024
1 parent 1531f75 commit 291e02c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions distribution/src/dist/usr/lib/systemd/system/openfire.service
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ ExecStart=/bin/bash -c '/usr/share/openfire/bin/openfire.sh ${DAEMON_OPTS}'
Restart=on-failure
RuntimeDirectory=openfire

# Specify resource limits in the slice
Slice=openfire.slice
# We expect a lot of connections from many clients so increase limit of file descriptiors
LimitNOFILE=50000
# The Openfire is less important for CPU than system vital services
Nice=5
# If not enough RAM then kill the Openfire first to preserve system vital services
OOMScoreAdjust=-100

[Install]
WantedBy=multi-user.target
Alias=xmpp.service
5 changes: 5 additions & 0 deletions distribution/src/dist/usr/lib/systemd/system/openfire.slice
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Slice]
#MemoryAccounting=yes
#MemoryMax=95%
#CPUQuota=95%
#CPUAccounting=yes

0 comments on commit 291e02c

Please sign in to comment.