-
Notifications
You must be signed in to change notification settings - Fork 375
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 enforces 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 we set the limit 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
The custom script and run command extensions are exempt from cgroups limits, since we cannot safely predict the workload they will run.
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.
If cgroups limits cause any issues, you can opt-out by updating the following config in /etc/waagent.conf
:
CGroups.EnforceLimits=y
To exclude other extensions from limits, you can update the following config:
CGroups.Excluded=customscript,runcommand
These values should be comma separated, and work with a case-insensitive grep-style match.
Also feel free to open an issue with feedback on this feature.