Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The AWeSomeness of Fargate

The AWeSomeness of Fargate

Fargate is a new compute engine for Amazon ECS that allows you to very easily run Docker containers for your applications without having to manage any underlying virtual machines.

Mark Taylor

March 20, 2019
Tweet

More Decks by Mark Taylor

Other Decks in Technology

Transcript

  1. What is Amazon Fargate? • Fargate is a new compute

    engine for Amazon ECS. • It allows you to very easily run Docker containers in the cloud. • Focus on building your application instead of worrying about managing infrastructure. • It is an alternative Launch Type to EC2.
  2. EC2 Launch Type The EC2 launch type allows you to

    run a containerised application on a cluster of EC2 instances that you manage. Containers are placed onto an instance based on resource requirements and placement strategy (binpack, random, spread).
  3. Fargate Launch Type The Fargate launch type allows you to

    run a containerised application without having to manage back end infrastructure.
  4. The Cost - EC2 On Demand Pricing t2.medium – 2

    x vCPU, 4 GB RAM = $0.052 per hour. Reserved Instance Pricing (1 year all up front) t2.medium – 2 x vCPU, 4 GB RAM = $0.034 per hour equivalent. Pricing is per second with a 60 second minimum.
  5. The Cost - Fargate Equivalent to t2.medium 2 vCPU =

    $0.09312 4GB RAM = $0.02044 Hourly cost = $0.11356 Pricing is per second with a 60 second minimum. Duration includes the time to pull in the container image.
  6. Pros of Fargate • No need to manage underlying EC2

    images, particularly security updates. • Less complexity. • Flexibility. It’s quick and easy to spin up new containers. • Scalability, no need to worry about availability of host resources. • Network rules per container. • Security rules per container. • You only pay for what you use.
  7. Cons of Fargate • Cost can be higher depending on

    usage. Higher than EC2 instance of the same specification, fully utilised, running 24/7. • No easy access via docker exec from the host (needs SSH agent). • Must use a log aggregator, for example Cloud Watch or an ELK stack. • Lack of control over host type e.g. CPU optimised instance – e.g. not good for machine learning! • Longer spinup times. • No persistent filesystem access (use S3!).
  8. So when should I use Fargate? • When you want

    a simple life, no need to worry about security patching and general host maintenance. • For micro services. Easy and unrestrained horizontal scaling. Spin up 1000s of containers in seconds. • Applications where you require container level network or security rules (e.g. Intranet). • Short lived instances, e.g. message queue consumers.
  9. The good news • You don’t have to go with

    just one or the other! • An ECS service can use a mix of both Fargate and EC2 tasks. • Use the right tool for the job.
  10. What do DealTrak do? • We currently have a hybrid

    approach. • Our monolith primary application runs on m4.xlarge EC2 instances. The primary reason for this is burst-able resource usage, containers can “borrow” from the host when required. • All our MQ consumers run on Fargate as we scale up and down frequently for processing finance proposal sends and decisions. • Our non Monolithic Micro Service apps run on Fargate. • Our Intranet runs on Fargate, due to security requirements.