- [Instructor] In addition to name spaces the Docker
engine also utilizes cgroups or control groups for isolation
the difference is that control groups provide resource
isolation, Linux C groups were introduced in 2006
and are available in most Linux distributions today.
The Docker engine allows you to leverage these cgroups
to prioritize the resources for your running containers.
In general, cgroups can be used to control a variety
of resources but in Docker, the most common uses
are for container CPU limits, CPU reservations,
memory limits, and memory reservations.
You should know that to use cgroups in Docker, there are
strict kernel requirements, so if you plan to use cgroups,
make sure that your kernel and your version of Linux
is going to be compatible.
Most importantly cgroups prevent runaway containers
from bringing down an entire Docker host.
A common example would be cgroups preventing a (mumbles)
service attack or preventing noisy neighbor syndrome
in a multi-tenant environment.
For example when you have multiple companies or multiple
users on a single host all sharing resources if one
particular application from one company is maximizing
that server's resources you don't want that to slow down
all of the other companies or all of the other applications
running on the same host.
In Docker for Windows, control groups are called job objects
but they're just as useful as Linux cgroups.
You can use Docker control groups with the Docker run
command, for example minus C or --cpu-shares will allow
you to allocate a specific number of shares to that
container that you're bringing up.
Similarly the -memory bytes command will allow you to set
a memory limit or --memory-reservation will allow you
to set a memory soft limit.
For more information on cgroups in Docker, I recommend
you check out this Docker documentation entitled
limiting a container's resources.
For your Docker certified associate exam, you should be
aware of what cgroups are and what command syntax you might
use to control container resources
in a production environment.