DCA practice question 17 of 25

Will this Linux kernel facility limit a Docker container's access to host resources, such as CPU or memory? Solution: cgroups

Full set: 191 questions
Answer options
A: Yes Correct answer
B: No
Correct Answer:
A. Yes
Explanation

Yes, cgroups (control groups) are a fundamental Linux kernel feature that Docker leverages to enforce resource constraints on containers. When you specify limits for a container, such as --memory, --cpus, or --blkio-weight, Docker configures the appropriate cgroup for that container's processes. This mechanism allows Docker to control and limit the amount of CPU, memory, and block I/O that a container can use, ensuring that a single container cannot exhaust host resources and impact other containers or the host system itself.

Why Incorrect

B. This is incorrect because cgroups are the specific kernel technology used for resource accounting and limiting, which is a core component of Docker's containerization model on Linux.

References

1. Docker Docs, Runtime options with Memory, CPUs, and GPUs. "By default, a container has no resource constraints and can use as much of a given resource as the host’s kernel scheduler allows. Docker provides ways to control how much memory, or CPU a container can use, setting runtime configuration flags of the docker run command. This section provides details on when you should set such limits and the possible implications of setting them." (https://docs.docker.com/config/containers/resourceconstraints/)

2. Red Hat Documentation, "Chapter 1. Introduction to Control Groups (Cgroups)". "Control Groups, usually referred to as cgroups, are a Linux kernel feature that allows you to allocate resources... and to put limits on those resources." (https://access.redhat.com/documentation/en-us/redhatenterpriselinux/7/html/resourcemanagementguide/chap-introductiontocontrolgroups)

3. University of Chicago, CMSC 33100/23100, Lecture 18: Containers. "Resource limits: cgroups. Cgroups (control groups) are a Linux kernel mechanism for limiting/monitoring/isolating the resource usage of a collection of processes." (https://uchicago-cs.github.io/cmsc33100-2021/slides/l18-containers.pdf, Slide 11)

Scroll to Top