0
0
Dockerdevops~20 mins

Service scaling in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Service Scaling Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Scaling a Docker service with the CLI
You run the command docker service scale web=3 on a Docker Swarm cluster. What is the expected output or system state change?
AThe command fails with a syntax error due to missing flags
BThe service named 'web' is scaled to 3 replicas, but the CLI outputs an error 'service not found'
CThe service named 'web' is scaled to 1 replica, ignoring the number 3
DThe service named 'web' is scaled to 3 replicas, and the CLI outputs 'web scaled to 3'
Attempts:
2 left
💡 Hint
Remember that docker service scale changes the number of replicas for an existing service.
🧠 Conceptual
intermediate
2:00remaining
Understanding service scaling impact on containers
If you scale a Docker service from 2 to 5 replicas, what happens to the containers running the service?
AAll containers are stopped and replaced by 5 new containers
BThree new containers are created to reach 5 replicas, and the existing 2 continue running
CThe number of containers stays at 2, but each container handles more load
DThe service is paused until manual restart
Attempts:
2 left
💡 Hint
Think about how replicas relate to containers in Docker services.
Troubleshoot
advanced
2:00remaining
Troubleshooting failed service scaling in Docker Swarm
You try to scale a service with docker service scale api=10, but only 5 replicas run. What could be a likely cause?
AThe cluster has insufficient resources to run 10 replicas
BThe command syntax is incorrect and ignored
CDocker Swarm limits replicas to 5 by default
DThe service name 'api' is invalid
Attempts:
2 left
💡 Hint
Consider resource availability on the cluster nodes.
🔀 Workflow
advanced
3:00remaining
Correct sequence to scale a Docker service safely
Arrange the steps to safely scale a Docker service from 1 to 4 replicas:
A1,3,2,4
B2,1,3,4
C1,2,3,4
D1,2,4,3
Attempts:
2 left
💡 Hint
Think about checking status before and after scaling, then monitoring.
Best Practice
expert
3:00remaining
Best practice for scaling stateful services in Docker Swarm
Which approach is best when scaling a stateful service in Docker Swarm to avoid data inconsistency?
AUse persistent volumes and ensure the service supports multiple replicas safely
BScale the service rapidly to the desired number without volume considerations
CAvoid using Docker Swarm and run containers manually for stateful apps
DUse ephemeral storage and rely on container restart to recover data
Attempts:
2 left
💡 Hint
Think about data persistence and consistency in stateful applications.