Reputation: 5275
I have a server application that should run in Ubuntu OS multiple times and I want to use docker.
what is the best scenario here to get better performance ?
1- run all instance in a single container with docker and Ubuntu image
or
2- run a single instance of each app in separated containers
Option 2 seems better for my solution but I want to know how much more system resources is wasted on this case, and Ubuntu is loaded every times?
Upvotes: 1
Views: 1212
Reputation: 2822
You should realy use one container per instance, because only then you can scale, run und manage them individually. Without that docker would not make sense, a VM would not be so different.
Performance would not decrease noteable if your application would not use more ressources if it is using multiple times.
Docker containers alone are realy cheap. They share the kernal and use Copy on Write so they dont require more space than a single container.
Test it yourself with 100 Ubuntu Containers:
docker service create --name test ubuntu sleep 9999
docker service scale test=100
wait a few moments
docker service ls
you see it takes near to no resources
Upvotes: 2