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 questionsYes, 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.
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.
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)
Keep practicing
Take the free DCA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DCA practice questions
- Question 1Does this command create a swarm service that only listens on port 53 using the UDP proto…
- Question 2Will this command ensure that overlay traffic between service tasks is encrypted? Solutio…
- Question 4Does this describe the role of Control Groups (cgroups) when used with a Docker container…
- Question 5Can this set of commands identify the published port(s) for a container? Solution: docker…
- Question 6Will this command mount the host's '/data' directory to the ubuntu container in read-only…
- Question 7A company's security policy specifies that development and production containers must run…
