deep dive into aws ecs and spot instances at scale

22
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Deep Dive into AWS ECS and Spot Instances at Scale May 20 th , 2016 Pahud Hsieh, Chief Architect, miiiCasa

Upload: pahud-hsieh

Post on 16-Apr-2017

345 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: Deep Dive into AWS ECS and Spot Instances at Scale

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Deep Dive into AWS ECS and Spot Instances at Scale

May 20th, 2016

Pahud Hsieh, Chief Architect, miiiCasa

Page 2: Deep Dive into AWS ECS and Spot Instances at Scale

What to Expect from this Session

Old-Days Challenges

Solutions with ECS

What’s the Benefits

ECS v.s. Serverless

Demo

Page 3: Deep Dive into AWS ECS and Spot Instances at Scale

A Bit about Me

• IT Pro and developer for the past 15 years

• Chief Architect of Astra Cloud(miiicasa.com) from Taiwan

• Experienced in IoT cloud platform across multiple AWS regions

• AWS All-5 Certificates holder

Page 4: Deep Dive into AWS ECS and Spot Instances at Scale

Challenges

Page 5: Deep Dive into AWS ECS and Spot Instances at Scale

Old Days…

EC2 EC2EC2 EC2

EC2 EC2EC2

Page 6: Deep Dive into AWS ECS and Spot Instances at Scale

the more micro-services we built,the more EC2 instances we have to manage(pay)

Page 7: Deep Dive into AWS ECS and Spot Instances at Scale

What We Expect

resource consolidation and isolation

fully-managed immutable infrastructure

self-healing and auto scaling(both infra and service)

designed for micro-services

spot instances with maximal cost optimization

Page 8: Deep Dive into AWS ECS and Spot Instances at Scale

EC2 Contaner Servicesa highly scalable, fast, container management service that makes it easy to run, stop, and manage

Docker containers on a cluster of Amazon EC2 instances

Page 9: Deep Dive into AWS ECS and Spot Instances at Scale

Let’s upgrade it

Page 10: Deep Dive into AWS ECS and Spot Instances at Scale

m3.medium $0.012/hr

nginx * 2php-fpm * 2nginx * 4 node * 2node * 4

Page 11: Deep Dive into AWS ECS and Spot Instances at Scale

ECS Service Auto Scaling(just released)

Page 12: Deep Dive into AWS ECS and Spot Instances at Scale
Page 13: Deep Dive into AWS ECS and Spot Instances at Scale

Benefits?

Page 14: Deep Dive into AWS ECS and Spot Instances at Scale

Benefits

fully-managed instances by ASG

fully-managed containers and services by ECS

self-healing and auto-scaling out-of-the-box

EC2 Instance Auto Scaling and ECS Service Auto Scaling

focus on your micro-services, instead of infrastructure

cost optimization with spot, <$10 per m3.medium per month

Page 15: Deep Dive into AWS ECS and Spot Instances at Scale

ECS or Serverless?

Page 16: Deep Dive into AWS ECS and Spot Instances at Scale

ECS over Serverless

cpu-bound computing

require higher memory(>1.5GB)

long running processes(>5min or even more)

invocation-intensive functions or libraries

microservice endpoints for internal only

- OpenResty or Express may be preferable

preferable languages like golang, Erlang, Ruby, php.etc.

use cases like MQTT, websockets,etc.

higher concurrent execution(>1000)

- lambda soft limit = 100

- with even more restrictions inside VPC

Page 17: Deep Dive into AWS ECS and Spot Instances at Scale

Serverless over ECS

short-living with limited CPU/memory usage

not invocation-intensive

microservice endpoints mostly for external

- with API Gateway and Custom Authorizer

preferable in java8, nodejs4.3 or python2.7

lower concurrent execution(<100)

you want to focus on the code, nothing else

“glue” AWS services

you need quick implementation, PoC or Demo

Page 18: Deep Dive into AWS ECS and Spot Instances at Scale

ECS with Serverless

ECS for queue/workers scenario with ASG and CloudWatch

- serverless enqueue, ECS dequeue

Async ecs run-task from Lambda or service proxied by API

Gateway

CloudWatch Events + Lambda + ECS(cron-like batch job)

Page 19: Deep Dive into AWS ECS and Spot Instances at Scale

DemoChatOps with ECS and Serverless

Page 20: Deep Dive into AWS ECS and Spot Instances at Scale

ChatOps with IM

auto-scaling and self-healing - design for failure

Ops on-the-go (anywhere, anytime)

create “sns2im” SNS topic and subscribe it with Lambda

alarm notifications with pre-defined action buttons

100% serverless architecture(API Gateway and Lambda)

Page 21: Deep Dive into AWS ECS and Spot Instances at Scale

ContactsPahud Hsieh

[email protected]

@pahudnet

fb.com/pahudnet

@pahud

@pahudnet

Page 22: Deep Dive into AWS ECS and Spot Instances at Scale

Thank You