Upload
pahud-hsieh
View
345
Download
1
Embed Size (px)
Citation preview
© 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
What to Expect from this Session
Old-Days Challenges
Solutions with ECS
What’s the Benefits
ECS v.s. Serverless
Demo
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
Challenges
Old Days…
EC2 EC2EC2 EC2
EC2 EC2EC2
the more micro-services we built,the more EC2 instances we have to manage(pay)
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
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
Let’s upgrade it
m3.medium $0.012/hr
nginx * 2php-fpm * 2nginx * 4 node * 2node * 4
ECS Service Auto Scaling(just released)
Benefits?
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
ECS or Serverless?
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
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
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)
DemoChatOps with ECS and Serverless
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)
Thank You