There is a multicore server, you need to use all of its kernels, the application works like a Docker container, deployed via wercker . Using node.js cluster module does not make sense because the container uses 1 core ( is this correct? ). I do not use docker-compose . Thoght about:

  1. Still, use node cluster to create several application instances, and when starting the container, specify the cpus=CORES_QUANTITY . Ie: if I create 10 instances in a container and specify cpus=10 , then one container with 10 workers should be launched, which will use 10 cores. But is it?
  2. Run it as Docker Swarm on a single server. Then you need to create a service, and linking, as when creating a container, the service is impossible. And you need to bind some more services (DB, for example). If I create one network for them, then the containers will not need to link? In this manner:

docker service create --network primary --replicas 10 MyApp

docker service create --network primary --replicas 2 MyDB

Is it possible? And how will they balance each other, communicate?

Or maybe there are more options?

  • because the container uses 1 core (is this correct?) - of course not - etki

1 answer 1

I do not use docker-compose

In vain. You can describe the network and just deploy .

 docker stack deploy -c docker-compose.yml stack_name 

Read more about directives .