4

In a docker-swarm mode setup, say I have a container accepting requests from other containers or from components external to the swarm.

Is there a mechanism to configure the swarm to auto-scale the number of containers running that specific tasks on demand and to stop them with decreasing load?

Say I already have n replicas of this container deployed but want it to scale automatically if need to be and any newly spawned ones must be brought down as load reduces.

Is this feature supported?

I found this thread in the docker-forum, but does not explain much: https://forums.docker.com/t/ingress-load-balancing/16600/2

Shabirmean
  • 2,341
  • 4
  • 21
  • 34
  • 2
    No, you'll need to monitor the load (with something like Prometheus) then trigger a replica increase / decrease as required. Little bit of plumbing required to do this right now. – johnharris85 Feb 28 '17 at 03:13
  • @johnharris85: Thank You. Just to be sure you are a hundred percent sure about this feature not being available with docker-swarm as of now right? Also, what are the best options (like ** Prometheus**) that are out there? Do I run a monitoring tool like that in my swarm-manager a container and attach it to some port? – Shabirmean Feb 28 '17 at 03:21
  • Ye I'd run a tool like Prometheus in a container (centrally), then cAdvisor on each node (to report to Prometheus on each container) then code in some alert or whatever so that when a particular service utilization goes over 80% then call the scale replicas update API on the Swarm for that service. – johnharris85 Feb 28 '17 at 04:04

0 Answers0