-
Notifications
You must be signed in to change notification settings - Fork 376
CGroups support
Starting with version 2.2.31, WALinuxAgent monitors memory and cpu usage for all agent and extension processes through the use of cgroups. When a process is not part of a cgroup, we will create one and move the process into that cgroup. These live under /sys/fs/cgroup/<cpu|memory>/WALinuxAgent
.
Starting with version 2.2.32, WALinuxAgent allows enforcing a limit for cpu and memory usage for all agent and extension processes which are not managed through systemd. The primary goal is to prevent runaway processes, so the limit is fairly high:
- for the agent itself, the limits are 10% of a single core and 15% total memory, with a minimum of 256mb and maximum of 512mb
- for extensions, the limit is 40% of a single core, and 15% total memory, with a minimum of 256mb
Enforcing resource limits is still an experimental feature and is disabled by default. If you would like to try this feature, you can opt-in by updating the following config in /etc/waagent.conf
:
CGroups.EnforceLimits=y
The custom script and run command extensions are exempt from cgroups limits, since we cannot safely predict the workload they will run.
To exclude other extensions from limits, you can update the following setting in /etc/waagent.conf:
CGroups.Excluded=customscript,runcommand
These values should be comma separated, and work with a case-insensitive grep-style match.
Wherever cgroups are managed via systemd (the agent service in Ubuntu 18.04 for example) we do not attempt to enforce limits, as systemd provides a standard set of tools and config for management. Please refer to systemd documentation in those cases.