1

I was looking through the documentation and it seems than it is not possible to isolate processes in Docker swarm to a specific core, like when you use numactl or cpuset--cpus. In docker run you do it like this (16 cpu machine, use 8 cpus on second socket from 8-15):

/usr/bin/docker run --detach --name myproc --cpus 8 --cpuset-cpus 8-15 --cpuset-mems 1 --  privateregistry:5000/myimage:v1 -c '/bin/myverycpuintensiveprocess.sh'

And I can confirm the processes do not jump from core to core but stay pinned on CPUS 8-15. Also they will use memory from socket 1 as well.

From the 'create service' documentation I see than the closest you have is '--reserve-cpu' and --reserve-memory' but that's only to control container placement.

Is this level of control banned from Docker Swarm? I was also looking at K8s and it seems to have the same limitations.

Thanks,

acid_fuji
  • 6,287
  • 7
  • 22
josegts
  • 107
  • 1
  • 13
  • Both Docker Swarm and Kubernetes are designed for multi-host systems and you usually don't control which host a container is running on, much less allocate specific cores. – David Maze Oct 17 '20 at 15:05
  • That is not true at all. in Docker Swarm you have node constraints and node labels on K8s to control where you want to run specific process (say machine wirth SSD disk, or server with 500GB of RAM or servers connected closer to market data source). – josegts Oct 18 '20 at 16:04
  • Hi, I want to clarify the previous comment (stackoverflow has a weird rule that you can only edit a comment for 5 minutes :-)) In Docker Swarm you have node constraints ([--constraint](https://docs.docker.com/engine/reference/commandline/service_create/)) and [node affinity](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) on K8s to control where you want to run specific process (say machine wirth SSD disk, or server with 500GB of RAM or servers connected closer to market data source). – josegts Oct 18 '20 at 16:11
  • I found than this is supported in Kubernetes, using a 'CPU Manager': https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ Still looking for a way to achieve the same on Docker Swarm. – josegts Oct 19 '20 at 14:31

1 Answers1

0

It is not supported at the moment, it is a issue on GitHub, people should vote for this feature.

josegts
  • 107
  • 1
  • 13