ansible.posix.cgroup_perf_recap callback – Profiles system activity of tasks and full execution using cgroups
Note
This callback plugin is part of the ansible.posix collection (version 1.5.4).
You might already have this collection installed if you are using the ansible
package. It is not included in ansible-core
. To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ansible.posix
. You need further requirements to be able to use this callback plugin, see Requirements for details.
To use it in a playbook, specify: ansible.posix.cgroup_perf_recap
.
Callback plugin
This plugin is an aggregate callback. It adds additional console output next to the configured stdout callback. See Callback plugins for more information on callback plugins.
Synopsis
- This is an ansible callback plugin utilizes cgroups to profile system activity of ansible and individual tasks, and display a recap at the end of the playbook execution
Requirements
The below requirements are needed on the local controller node that executes this callback.
- whitelist in configuration
- cgroups
Parameters
Parameter | Comments |
---|---|
control_group string / required | Name of cgroups control group Configuration:
|
cpu_poll_interval float | Interval between CPU polling for determining CPU usage. A lower value may produce inaccurate results, a higher value may not be short enough to collect results for short tasks. Default: Configuration:
|
display_recap boolean | Controls whether the recap is printed at the end, useful if you will automatically process the output files Choices:
Configuration:
|
file_name_format string | Format of filename. Accepts Default: Configuration:
|
file_per_task boolean | When set as Choices:
Configuration:
|
memory_poll_interval float | Interval between memory polling for determining memory usage. A lower value may produce inaccurate results, a higher value may not be short enough to collect results for short tasks. Default: Configuration:
|
output_dir path | Output directory for files containing recorded performance readings. If the value contains a single %s, the start time of the playbook run will be inserted in that space. Only the deepest level directory will be created if it does not exist, parent directories will not be created. Default: Configuration:
|
output_format string | Output format, either CSV or JSON-seq Choices:
Configuration:
|
pid_poll_interval float | Interval between PID polling for determining PID count. A lower value may produce inaccurate results, a higher value may not be short enough to collect results for short tasks. Default: Configuration:
|
write_files boolean | Dictates whether files will be written containing performance readings Choices:
Configuration:
|
Notes
Note
- Requires ansible to be run from within a cgroup, such as with
cgexec -g cpuacct,memory,pids:ansible_profile ansible-playbook ...
- This cgroup should only be used by ansible to get accurate results
- To create the cgroup, first use a command such as
sudo cgcreate -a ec2-user:ec2-user -t ec2-user:ec2-user -g cpuacct,memory,pids:ansible_profile
Hint
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.
Collection links
© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/ansible/posix/cgroup_perf_recap_callback.html