...

/

Scaling Up the Service

Scaling Up the Service

Learn how to scale your app using Docker Swarm.

Scaling up by Swarm

Currently, each of our services has been backed by a single task (and therefore container). We can instruct Swarm to increase or decrease the number of containers backing a service. This is known as scaling the service.

From the previous discussion, it should be clear how Swarm implements scaling. Imagine that the swarm receives a new definition of the web service which specifies three containers. The orchestrator sees that only one task has been scheduled and that therefore two more containers are required. It proceeds to create two new tasks, scheduling them across the available nodes in the cluster.

The node (or nodes) allocate the tasks, then start up one container for each task they have been assigned. And voilà, we have scaled up our ...