liveBook · Manning

Service scale

As explained in Learn Docker in a Month of Lunches, Second Edition

Service scale is the number of container instances running for a Compose service.

Service scale is the number of container instances running for a Compose service. A stateless API service can run in multiple containers, allowing requests from a web container to reach any running instance. section 7.2

Scale the image API

Run `docker compose up -d --scale iotd=3`, refresh `http://localhost:8010`, and inspect `docker compose logs --tail=1 iotd`. Compose creates two additional containers, giving the iotd service a scale of three; requests may be handled by different containers. section 7.2

docker compose up -d --scale iotd=3
# browse to http:/./localhost:8010 and refresh
docker compose logs --tail=1 iotd

Use the runnable command sequence to increase service scale, exercise the application, and inspect per-container logs. section 7.2

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Demonstrates scaling commands, request distribution, and filtered logs, but does not explain scheduling or networking internals.
Examples
Uses the iotd service, three containers, browser refreshes, and per-container Compose logs.
What you can do after
Operate/configure a Compose service at a chosen scale and verify which containers handle application requests.
How it connects
Connects Docker Compose with stateless services, containers, service dependencies, and the Docker CLI.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.