Docker – Understanding the use of docker on AWS instances

amazon ec2amazon-web-servicesdocker

I've read that the basic Amazon Ami has built in docker support.

There are a few things I don't understand that perhaps someone could help with.

  1. Is a VM (AWS instance) slower to boot than a docker container?

  2. Would I get more performance from 2 small VM's running a docker application within them, than 1 large VM running 2 docker applications within itself?

  3. Are there any scenarios/services where I can take advantage of the boot speed of a container over the boot speed of a VM (AWS instance) for autoscaling an application?

Thank you

Best Answer

Just last week Amazon posted a blog post on container computing. The benefits are summed up pretty well there.

Is a VM (AWS instance) slower to boot than a docker container?

Yes absolutely, boot an EC2 instance and it'll probably take a few minutes. Start a docker container and it'll probably be running within seconds.

Would I get more performance from 2 small VM's running a docker application within them, than 1 large VM running 2 docker applications within itself?

You'd probably get better overall efficiency from a single large instance as there's only the overhead of one host OS. Obviously there's other concerns besides performance such as availability and so it might still be wise to run two instances (especially if they're in different Availability Zones).

Are there any scenarios/services where I can take advantage of the boot speed of a container over the boot speed of a VM (AWS instance) for autoscaling an application?

Maybe, you're probably going to be limited by the overall capacity of the host VM so if you exceed this capacity you're going to have to spin up another VM. Having said that, if you have spare capacity on another host you may be able to move things around more quickly to make better use of your capacity.