From the course: Docker on AWS

Fargate or EC2 for containers

From the course: Docker on AWS

Start my 1-month free trial

Fargate or EC2 for containers

- [Instructor] When comparing the possible ECS services, you find that there are actually two models for the underlying compute resources. One is to use EC2 instances, and have the ECS service manage the deployment of those EC2 instances, and the other is to use the Fargate service, which is a managed container service provided by Amazon directly. The biggest difference is really in how you get billed for those resources, in that, in the EC2 case, you get billed for an EC2 instance as if you had just deployed a standard EC2 instance for any other purpose. The Fargate environment, on the other hand, you get billed based on the actual container running CPU and memory, and the amount of time that that's consumed for you. So, it really is a difference between whether you really want to manage the capacity. Looking at, for example, on the EC2 side of things, you can put together a fairly large instance if you have very large containers, and you know the sort of, over subscription rate of those containers and what they need to be. Versus the Fargate environment, where the containers are going to be packed on to whatever available nodes are a part of that overall ECS underlying Fargate service, and you have a little bit less control there. Both are interesting. If you actually need access to the underlying container resources for some reason, you might be forced back into the EC2 space. If you can make do without having to get ahold of that, and just want to run your services, Fargate is maybe a much better choice for you.

Contents