logo
Published on

ECS - EC2 Architecture

Authors
  • avatar
    Name
    Bowen Y
    Twitter

ECS - EC2 Architecture

ecs-ec2

Comparison with Fargate

The challenge of running EC2 instances is that they are servers. You have to patch them and keep them updated. You have to manage logging, manage ssh keys, manage what happens when you run out of disk space, etc. Your business doesn't really get any value out of managing those things specifically, but historically we've accepted that we have to do those things if we want to run our app.

What Fargate gives you is the ability to run your app, in a container, without having to manage or care about any of that stuff mentioned above. That's the value proposition that Fargate gives you. Run the app that your business cares about, and don't care about anything else.

But this isn't Lambda, it's still a container that's running (and costing) all the time, even if nobody is using it. If paying for potentially idle compute time is a deal-breaker for you, then you'll want to look into refactoring your application to run on Lambda. This is probably not a small task, and in some cases not a possible task at all.

price

As for always-running services like web server, managing ECS with EC2 instances is about 20% cheaper than using ECS with Fargate.

Reference: https://www.clickittech.com/devops/fargate-pricing/

Comparing AL2 and Amazon Linux 2023

Refenrence: https://docs.aws.amazon.com/linux/al2023/ug/compare-with-al2.html