Scaling Up

Learn how to scale up your application.

Scale Up the Web Service

Currently, we have a single container (or replica) of each service running on our swarm. However, with Swarm, we can scale up services to meet real or anticipated demand. Here we are talking about horizontally scaling your app, running multiple containers for service, each of which can handle a certain amount of load.

To scale our web service up to run three containers, the following command is used (you can try in the terminal below):

$ docker service scale myapp_web=3

You will be able to see the visualizer updating in real-time as containers are launched and move into the “running” state. When the command has completed, you will see there are now three web containers as shown in the following figure:

Get hands-on with 1200+ tech skills courses.