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>
(cherry picked from commit 562d330484
)
This commit is contained in:
parent
248bc02264
commit
353aba1f4f
@ -123,3 +123,7 @@ magnum_role_project_group: magnum_all
|
|||||||
# Store certificates in DB by default (x509keypair)
|
# Store certificates in DB by default (x509keypair)
|
||||||
# Other valid values are: barbican, local
|
# Other valid values are: barbican, local
|
||||||
magnum_cert_manager_type: x509keypair
|
magnum_cert_manager_type: x509keypair
|
||||||
|
|
||||||
|
magnum_api_init_config_overrides: {}
|
||||||
|
magnum_conductor_init_config_overrides: {}
|
||||||
|
|
||||||
|
@ -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.
|
@ -21,6 +21,7 @@
|
|||||||
system_group: "{{ magnum_system_group_name }}"
|
system_group: "{{ magnum_system_group_name }}"
|
||||||
service_home: "{{ magnum_system_user_home }}"
|
service_home: "{{ magnum_system_user_home }}"
|
||||||
log_directory: "{{ magnum_log_directory }}"
|
log_directory: "{{ magnum_log_directory }}"
|
||||||
|
init_config_overrides: "{{ magnum_api_init_config_overrides }}"
|
||||||
|
|
||||||
- include: magnum_init_common.yml
|
- include: magnum_init_common.yml
|
||||||
vars:
|
vars:
|
||||||
@ -30,3 +31,4 @@
|
|||||||
system_group: "{{ magnum_system_group_name }}"
|
system_group: "{{ magnum_system_group_name }}"
|
||||||
service_home: "{{ magnum_system_user_home }}"
|
service_home: "{{ magnum_system_user_home }}"
|
||||||
log_directory: "{{ magnum_log_directory }}"
|
log_directory: "{{ magnum_log_directory }}"
|
||||||
|
init_config_overrides: "{{ magnum_conductor_init_config_overrides }}"
|
||||||
|
@ -38,12 +38,14 @@
|
|||||||
group: "root"
|
group: "root"
|
||||||
|
|
||||||
- name: Place the systemd init script
|
- name: Place the systemd init script
|
||||||
template:
|
config_template:
|
||||||
src: "magnum-systemd-init.j2"
|
src: "magnum-systemd-init.j2"
|
||||||
dest: "/etc/systemd/system/{{ program_name }}.service"
|
dest: "/etc/systemd/system/{{ program_name }}.service"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
owner: "root"
|
owner: "root"
|
||||||
group: "root"
|
group: "root"
|
||||||
|
config_overrides: "{{ init_config_overrides }}"
|
||||||
|
config_type: "ini"
|
||||||
register: systemd_init
|
register: systemd_init
|
||||||
|
|
||||||
- name: Reload the systemd daemon
|
- name: Reload the systemd daemon
|
||||||
|
@ -22,5 +22,14 @@ TimeoutSec=300
|
|||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=150
|
RestartSec=150
|
||||||
|
|
||||||
|
# This creates a specific slice which all magnum services 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]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
Loading…
Reference in New Issue
Block a user