Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Ask systemd to track memory consumption
Browse files Browse the repository at this point in the history
Allows tracking memory consumption on a per-unit and per-cgroup basis.

https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html#MemoryAccounting=

closes: #7192
https://pulp.plan.io/issues/7192
  • Loading branch information
dralley committed Jul 22, 2020
1 parent efb6bd1 commit 91fda4e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/7192.feature
@@ -0,0 +1 @@
Enable resource accounting via systemd.
5 changes: 4 additions & 1 deletion roles/pulp_api/templates/pulpcore-api.service.j2
Expand Up @@ -22,12 +22,15 @@ ProtectSystem=full
PrivateTmp=yes
PrivateDevices=yes


# This provides reconnect support for PostgreSQL and Redis. Without reconnect support, if either
# is not available at startup or becomes disconnected, this process will die and not respawn.
Restart=always
RestartSec=3

# Enables tracking of process resource consumption at a unit & cgroup level.
CPUAccounting=yes
MemoryAccounting=yes

# This directive is set to an absolute path in other Pulp units. Using an
# absolute path is an abuse of the directive, as it should be a relative path,
# not an absolute path. PIDFile is now used to ensure that PID files are laid
Expand Down
3 changes: 3 additions & 0 deletions roles/pulp_content/templates/pulpcore-content.service.j2
Expand Up @@ -20,6 +20,9 @@ ExecStart={{ pulp_install_dir }}/bin/gunicorn pulpcore.content:server \
-w 2 \
--access-logfile -

# Enables tracking of process resource consumption at a unit & cgroup level.
CPUAccounting=yes
MemoryAccounting=yes

# This provides reconnect support for PostgreSQL and Redis. Without reconnect support, if either
# is not available at startup or becomes disconnected, this process will die and not respawn.
Expand Down
Expand Up @@ -20,6 +20,9 @@ ExecStart={{ pulp_install_dir }}/bin/rq worker \
-c 'pulpcore.rqconfig' \
--disable-job-desc-logging

# Enables tracking of process resource consumption at a unit & cgroup level.
CPUAccounting=yes
MemoryAccounting=yes

# This provides reconnect support for PostgreSQL and Redis. Without reconnect support, if either
# is not available at startup or becomes disconnected, this process will die and not respawn.
Expand Down
3 changes: 3 additions & 0 deletions roles/pulp_workers/templates/pulpcore-worker@.service.j2
Expand Up @@ -22,6 +22,9 @@ ExecStart={{ pulp_install_dir }}/bin/rq worker \
-c 'pulpcore.rqconfig' \
--disable-job-desc-logging

# Enables tracking of process resource consumption at a unit & cgroup level.
CPUAccounting=yes
MemoryAccounting=yes

# This provides reconnect support for PostgreSQL and Redis. Without reconnect support, if either
# is not available at startup or becomes disconnected, this process will die and not respawn.
Expand Down

0 comments on commit 91fda4e

Please sign in to comment.