Docker container resource

From HPCWIKI
Revision as of 10:44, 2 May 2023 by Admin (talk | contribs) (→‎Default container resource)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Container resource

By default, Docker containers are constrained to use a limited amount of system resources, such as CPU, GPU, memory, and disk space to ensure that containers do not consume excessive resources and cause problems for other containers or the host system. By default, Docker sets resource limits for each container based on the host system's available resources. The exact resource limits that are set can vary depending on the host system's configuration and the specific Docker image being used.

It's worth noting that allowing a container to use excessive resources can lead to performance problems or even crashes on the host system. Therefore, it is generally recommended to use resource limits and monitor resource usage carefully when running Docker containers.


Docker uses a control group (cgroup) feature of the Linux kernel to limit the resources that a container can use. Chaining the cgroup feature allows Docker to set resource limits for a container's CPU, memory, network bandwidth, and other system resources.


However, it is possible to configure Docker to allow a container to use more resources than the default limits. For example, you can use the docker run command to specify custom resource limits for a container or you can modify the default resource limits in the Docker daemon configuration file[1].

Reference