The main problem with multiple processes in one container is signal management: how do you (cleanly) stop all your processes?
This is a zombie reaping " PID 1 problem , so when you need to manage multiple processes, a basic image, for example, can help. phusion/baseimage-docker
A more general problem is the decoupling of the microservice: if both P1 and P2 are states and depend on each other, their storage in the same container makes sense.
What are the overhead associated with latency communications
It depends on the type of process involved, but the overhead is minimal, since both processes work on the same docker node (even if they are in separate containers).
source
share