Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a formula for calculating the overhead of a Docker container?

Tags:

docker

Supposed I want to run several Docker containers at the same time.

Is there any formula I can use to find out in advance on how many containers can be run at the same time by a single Docker host? I.e., how much CPU, memory & co. do I have to take into account for the containers themselves?

like image 582
Golo Roden Avatar asked Feb 15 '14 15:02

Golo Roden


People also ask

How much overhead does a docker container have?

Docker has a very low overhead, which means that you can simply add up the individual memory usages of the applications you plan to run inside Docker to calculate your memory usage. For some context, a machine with 16GB RAM is likely to be sufficient for running a few standard-sized containers.

How is Docker container performance measured?

You can use the docker stats command to live stream a container's runtime metrics. The command supports CPU, memory usage, memory limit, and network IO metrics. The docker stats reference page has more details about the docker stats command.

How do I check my container utilization?

If you need more detailed information about a container's resource usage, use the /containers/(id)/stats API endpoint. On Linux, the Docker CLI reports memory usage by subtracting cache usage from the total memory usage.


1 Answers

It's not a formula per se, but you can gather information about resource usage in the container by examining Linux control groups in /sys/fs/cgroup.

Links

See this excellent post by Jérôme Petazzoni of Docker, Inc on the subject.

See also Google's cAdvisor tool to view container resource usage.

This IBM research paper documents that Docker performance is higher than KVM in every measurement.

like image 145
Ben Whaley Avatar answered Oct 05 '22 10:10

Ben Whaley