Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
MXS-4155: Check CPU and MEM limits in Docker
If MaxScale is being run inside of a container with restricted CPU or memory resources, `threads=auto` used to use the host's core count instead of the one defined for the cgroup the container runs in. This commits adds correct detection of the CPU limits for the active cgroup. The new code checks for both v1 and v2 cgroup paths in /sys/fs/ for the `--cpus` and `--memory` docker options. In addition, the CPU affinity option `--cpuset-cpus` is detected if it is being used to pin the container to certain CPUs.
- Loading branch information
Showing
3 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters