14
votes

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?

3

3 Answers

18
votes

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.

1
votes

docker stats is also useful for getting a rough idea for how CPU and Memory your containers use.

0
votes

cAdvisor is going to provide resource usage and other interesting stats about all containers o a host. We have a preliminary setup for root usage, but we are adding a lot more this week.