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.6.2).
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 |
---|---|
Name of cgroups control group Configuration:
|
|
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:
|
|
Controls whether the recap is printed at the end, useful if you will automatically process the output files Choices:
Configuration:
|
|
Format of filename. Accepts Default: Configuration:
|
|
When set as Choices:
Configuration:
|
|
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 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, either CSV or JSON-seq Choices:
Configuration:
|
|
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:
|
|
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.