Ensure the components are isolated from the system

This creates a specific slice which all OpenStack services will operate
from. By creating an independent slice these components will be governed
away from the system slice allowing us to better optimise resource
consumption.

See the following for more information on slices:

* https://www.freedesktop.org/software/systemd/man/systemd.slice.html

See for following for more information on resource controls:

* https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html

Tools like ``systemd-cgtop`` and ``systemd-cgls`` will now give us
insight into specific processes, process groups, and resouce consumption
in ways that we've not had access to before. To enable some of this reporting
the accounting options have been added to the [Service] section of the unit
file.

Change-Id: I7f6d634eafeb47450127eed1e59f3e00ee3075a5
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2017-03-28 18:08:08 -05:00 committed by Kevin Carter (cloudnull)
parent 8329c257df
commit 562d330484
5 changed files with 27 additions and 1 deletions

View File

@ -122,3 +122,7 @@ magnum_role_project_group: magnum_all
# Store certificates in DB by default (x509keypair)
# Other valid values are: barbican, local
magnum_cert_manager_type: x509keypair
magnum_api_init_config_overrides: {}
magnum_conductor_init_config_overrides: {}

View File

@ -0,0 +1,9 @@
---
features:
- New variables have been added to allow a deployer to customize
a magnum systemd unit file to their liking.
- The task dropping the magnum systemd unit files now uses the
``config_template`` action plugin allowing deployers access to
customize the unit files as they see fit without having to
load extra options into the defaults and polute the generic
systemd unit file with jinja2 variables and conditionals.

View File

@ -21,6 +21,7 @@
system_group: "{{ magnum_system_group_name }}"
service_home: "{{ magnum_system_user_home }}"
log_directory: "{{ magnum_log_directory }}"
init_config_overrides: "{{ magnum_api_init_config_overrides }}"
- include: magnum_init_common.yml
vars:
@ -30,3 +31,4 @@
system_group: "{{ magnum_system_group_name }}"
service_home: "{{ magnum_system_user_home }}"
log_directory: "{{ magnum_log_directory }}"
init_config_overrides: "{{ magnum_conductor_init_config_overrides }}"

View File

@ -38,12 +38,14 @@
group: "root"
- name: Place the systemd init script
template:
config_template:
src: "magnum-systemd-init.j2"
dest: "/etc/systemd/system/{{ program_name }}.service"
mode: "0644"
owner: "root"
group: "root"
config_overrides: "{{ init_config_overrides }}"
config_type: "ini"
register: systemd_init
- name: Reload the systemd daemon

View File

@ -22,5 +22,14 @@ TimeoutSec=300
Restart=on-failure
RestartSec=150
# This creates a specific slice which all will operate from
# The accounting options give us the ability to see resource usage through
# the `systemd-cgtop` command.
Slice=magnum.slice
CPUAccounting=true
BlockIOAccounting=true
MemoryAccounting=false
TasksAccounting=true
[Install]
WantedBy=multi-user.target