<p>I have been looking into Docker containerization for a while now but few things are still confusing to me. I understand that all the containers are grouped into a cluster and cluster management tools like Docker Swarm, DC/OS, Kubernetes or Rancher can be used to manage docker containers. I have been testing out Container cluster management with DC/OS and Kubernetes, but still a few questions remain unanswered to me.</p>

<p><strong>How does auto scaling in container level help us in production servers?</strong> How does the application serve traffic from multiple containers? </p>

<p>Suppose we have deployed a web application using containers and they have auto scaled. How does the traffic flow to the containers? How are the sessions managed?</p>

<p>What metrics are calculated for autoscaling containers?</p>

<p>The autoscaling in DC/OS (note: Mesosphere is the company, DC/OS the open source project) the autoscaling is described in detail in the <a href="https://dcos.io/docs/1.8/usage/tutorials/autoscaling/" rel="nofollow">docs</a>. Essentially the same as with Kubernetes, you can use either low-level metrics such as CPU utilization to decide when to increase the number of instances of an app or higher-level stuff like app throughput, for example using the <a href="https://dcos.io/docs/1.8/usage/tutorials/autoscaling/microscaling-queue/" rel="nofollow">Microscaling</a> approach.</p>

<p>Regarding your question how the routing works (how are requests forwarded to an instance, that is a single container running): you need a load balancer and again, DC/OS provides you with this out of the box. And again, the options are detailed out in the <a href="https://dcos.io/docs/1.8/usage/service-discovery/load-balancing-vips/" rel="nofollow">docs</a>, essentially: HAProxy-based North-South or IPtables-based, East-West (cluster internal) load balancers.</p>
