<p>I have a few basic questions on scaling Docker containers:</p>

<p>I have 5 different apps. They are not connected to each other. Before having containers I would run 1 app per VM and scale them up and down individually in the cloud.</p>

<p>Now with containers I get the isolation on top of a VM, so now I can potentially run one host with 5 docker containers where each app is isolated in its own container.</p>

<p>As long as I have enough resources on my host I can scale up and down those containers individually as my traffic grows or shrinks. e.g. I have 3 containers running app 1, but only 1 container running app 2.</p>

<p>At peak times app 3 gets a lot of traffic and I need to launch a 2nd host which runs only containers for app 3.</p>

<p>My first question is if the above makes sense what I say or if I have misunderstood something. My second question is what technology is currently available to get this all done in an automated way. I need a load balancer and an auto scaling group which is capable of the above scenario without me having to do manual interventions.</p>

<p>I looked into AWS ECS and am not quite sure if it can satisfy my needs as I outlined it above.</p>

<p>Does anyone know how to achieve this, or is there a better way of managing and scaling my 5 apps which I am missing?</p>

<p><strong>UPDATE:</strong></p>

<p>Via Twitter I have been pointed to <a href="http://kubernetes.io/">Kubernetes</a> and specifically to the docs on the <a href="http://kubernetes.io/v1.1/docs/user-guide/horizontal-pod-autoscaler.html">Horizontal Pod Autoscaler</a>.</p>

<p>Might be useful for others as well. I will update this question as I learn more.</p>

<p>There are several options, but none that I know that does it all: you will need 2 things: autoscaling hosts according to signals, then autoscale containers on the hosts.</p>

<p>The following are the solutions to deploy and scale <em>containers</em> on the hosts (not necessarily <em>auto</em>-scale though):</p>

<p><strong>Kubernetes</strong> is an orchestration tool which allows to schedule and (with the optional autoscaler) to autoscale pods (groups of containers) in the cluster. It makes sure your containers are running somewhere if a host fails.
Google Container Engine (GKE) offers this as a service, however i am not sure they have the same functionalities to autoscale the number of VMs in the cluster as AWS does.</p>

<p><strong>Mesos</strong>: somewhat similar to Kubernetes but not dedicated to running containers.</p>

<p><strong>Docker Swarm</strong>: the Docker multi-host deployment solution, allows you control many hosts as if they were a single Docker host. I don't believe it has any kind of 'autoscaling' capability, and I don't believe it takes care of making sure pods are always running somewhere: it's basically docker for  cluster. </p>

<p><strong>[EDIT] Docker supports restarting failing containers with the <code>restart=always</code> option, also, as of Docker 1.11 Docker Swarm is a mode in Docker Daemon, and supports rescheduling containers on node failure: it will restart containers on a different node if a node is no longer available.</strong></p>

<p><strong>Docker 1.11+ is becoming a lot like Kubernetes in terms of functionalities. It has some nice features (like TLS between nodes by default), but still lacks things like static IPs and storage provisioning</strong></p>

<p>None of these solutions will autoscale the number of hosts for you, but they can scale the number of containers on the hosts. </p>

<p>For autoscaling hosts, solutions are specific to your cloud provider, so these are dedicated solution. The key part for you is to integrate the two: 
AWS allows deployment of Kubernetes on CoreOS; I don't think they offer this as a service, so you need to deploy your own CoreOS cluster and Kubernetes.</p>

<p>Now my personal opinion (and disclaimer) </p>

<p>I have mostly used Kubernetes on GKE and bare-metal, as well as Swarm a about 6 months ago, and i run an infra with ~35 services on GKE:</p>

<p>Frankly, GKE with Kubernetes as a Service offers most of what you want, but it's not AWS. Scaling hosts is still a bit tricky and will require some work.</p>

<p>Setting up your own Kubernetes or Mesos on AWS or bare metal is very feasible, but there is quite a learning curve: it all depends if you really strongly feel about being on AWS and are willing to spend the time.</p>

<p>Swarm is probably the easiest to get working with, but more limited, however homebuilt script can well do the job core job: use AWS APIs to scale hosts, and Swarm to deploy. The availability guarantee though would require you monitoring and take care of re-launching containers if a node fails.</p>

<p>Other than that, there are also container hosting providers that may do the job for you: </p>

<ul>
<li><p>Scalingo is one i know of but there are others. <a href="https://scalingo.com/" rel="nofollow">https://scalingo.com/</a></p></li>
<li><p>OVH Sail Above has this service in alpha. <a href="https://www.runabove.com/sailabove.xml" rel="nofollow">https://www.runabove.com/sailabove.xml</a></p></li>
</ul>
