Scaling is increasing the number of containers for any specific service. This is primarily helpful for a cluster, not on a single host setup like yours. When you scale your application up in a cluster, multiple containers of the same service get spread across the cluster (Based on their availability (Resource or anyway)). This makes the distribution of load across containers an available benefit. In a single host environment, with limited resources, scaling won't do you much good as the processes are going to be the slave of the same schedular, so you won't have that parallel servicing.
So now your question, why does scale in docker-compose exist? From the top of my head in no specific order of value:
- You can minimize your services' downtime (going as low as none) while upgrading with docker-compose's scale functionality.
- If an app can handle only so many inputs, in other words, if there's a queue of inputs, you can essentially increase the available queue space by scaling the container up and have multiple containers handle a portion of the inputs, reducing input loss.
- The more obvious one, if one container goes down, there will still be at least one replica left.