SlideShare a Scribd company logo
從劍宗到氣宗
談AWS ECS與Serverless最佳實踐
Pahud Hsieh
April19 2016, Taipei
Best Practice in AWS ECS and Serverless
• Last Updated: April/19 2016
• Scheduled for 45 minutes
- The Challenges
- Foundational Concepts of ECS and Serverless
- New Challenges
- The Future
• Q & A
A Bit About Me
• Both an 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 globally
• AWS All-5 Certificates holder
- AWS Certified Solution Architect - Associate
- AWS Certified SysOps - Associate
- AWS Certified Developer - Associate
- AWS Certified Solution Architect - Professional
- AWS Certified DevOps Engineer - Professional
Old-Schools
Web Web
RDS RDS
ELB/ASG
Web Web
Looking Good?
Challenges
• You pay too much for EC2 instances
• pay even much for micro services
• Complexity in Infrastructure
• VPC, subnet, routing-table, NAT, NACL, security groups, ELB, ASG
• Complexity in A/B testing and B/G deployment
• CFN re-deploy, EB env swap, CodePipeline/CodeDeploy, OpsWorks, etc.
• complexity means error-proneness
More Challenges
• dev/testing/QA/staging/prod consistency
• CI & CD challenges
• even worse to manage multiple AWS regions
• service decoupling means nightmares
Questions
• Can I just focus on my service stack unit, instead of computing unit(EC2) ?
• Self-Healing, Auto-Scaling, AZ-balancing ?
• Log Consolidation ?
• Immutable and Stateless Architecture ?
• Cost Optimization and Resource Optimization ?
• still having full control on my tech stack (frameworks and languages)
• simple deployment, A/B and B/G ?
a highly scalable, fast, container management service that makes it easy to run, stop,
and manage Docker containers on a cluster of Amazon EC2 instances.
AWS EC2 Container Service
ECS Cluster
ASG
on demand
ASG
spot instance
CloudWatch
Auto Scaling Policy Design
• scale out spot on 30%-60%
• scale out on-demand when >= 60%
• scale in on-demand when <60%
• scale in spot when <=30%
• with minimal 1 on-demand or RI
Simply Put
• on-demand/RI 打底 spot伸縮
• on-demand scale out last, scale in first
• try spot fleet if you need couples of instances(
lets talk about it next time )
external ELB
internal ELB
instance * 2
web * 2
app * 2
worker* 2
instance * 4
SQS
CloudWatch
web * 4
Benefits and Tips
• Leverage ELB to build micro-services
• Monitor service loading by CloudWatch and adjust spot fleet to scale out/in services/tasks
dynamically
• Self-healing in container level
• Fully-managed deployment and rolling update with revisions
• Better resource utilization
• Consolidate application logs to CloudWatch Logs
• Create filter, metrics and build alarms from CloudWatch Logs
• Push your docker images to ECR and deploy across regions with exactly the same image
What if 20-30 micro services?
ECS Service Load Balancing
docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balanc
Random ports LB and Service Discovery?
Load Balancing on Random Ports
http://www.slideshare.net/JulienSIMON5/amazon-ecs-january-2016/12
Meteor Galaxy
session-aware with random ports
share.net/AmazonWebServices/dvo313-building-nextgeneration-applications-w
Is there a way to move the code in
a cloud native way?
“No server is easier to manage than no server”
- Werner Vogels, Amazon CTO
AWS re:Invent 2015
AWS Lambda AWS API Gateway
“a compute service where you can
upload your code to AWS Lambda
and the service can run the code
on your behalf using AWS
infrastructure”
“a fully managed service that
makes it easy for developers to
create, publish, maintain, monitor,
and secure APIs at any scale”
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
Mobile Integration
AWS Lambda
RequestResponse(Sync)
Event(Asyc)
{“foo”:”bar”} event.context={“
foo”:”bar”}
SDK
API Gateway
Lambda function Integration
RESTful API
HTTP PUT /items/123
{“foo”:”bar”} event.param_id=123
event.http_body={“foo”:”bar”}
API Gateway
Service Proxy Integration
RESTful API
IAM assume role
execution
API Gateway Call Flow
Pros
• cloud native with your business code in Lambda
• no infrastructure to manage
• leverage AWS PaaS infrastructure at scale
• custom or federated authorization
• very minimal cost for small-medium teams
- 30m requests = $11.63 per month (Lambda)
- $4.25 per million requests(API Gateway)
http://www.slideshare.net/CaseyLee2/serverless-delivery
Cons - Lambda Limit
• Lambda soft limit concurrency is 100
• 300 seconds max duration per invocation
• Lambda in VPC restriction
- private IP addresses
- ENIC limit(default 20*5=100)
Cons - API Gateway
• 500-1000 QPS per AWS Account
• 5M requests / month = $18.79
• 100 QPS = $974.07 / month = 31,350NTD
• No async or parallel invocation with Lambda
Cons - Performance
• push and pull invocation model of Lambda
• -> delegation with higher memory
• no connection pooling
• -> always open/close conn in handler scope
Cons - Development
• CloudWatch debugging
• immature CI/CD toolchains
• lack of PHP, Ruby and Golang
• re-deploy the whole bundle could be a pain
When should I use ECS,
instead of serverless?
Use ECS
• financial concern - When you have traffic more than 100QPS+
• operation concern - Long running process or API service
• language concern - Golang, PHP, Ruby, etc.
• performance concern - need really big memory or CPU-
optimized
• protocol concern - websockets, MQTT, other TCP protocols
Use Serverless
• small project, simple business logic
• focus on the code only
• no infrastructure management
• stateless
• quick micro services implementation
• simply integrated with other AWS services
- i.e. API Gateway update DynamoDB, Kinesis, SQS as service proxy.
Conclusions
• containerize your stack, and try serverless as much as you can
• build stateless application
• immutable architecture - every computing component can be replaced and scaled with
no impact
• focus on your business logic, instead of the infrastructure, forget your infrastructure
• try not use any EC2, if necessary, avoid SSH into EC2 for manual operation
• fully-managed and fully-automation is the way to go
• embrace event-driven cloud computing
See You Next Time
Your Success Is Our Success
Thank You
Pahud Hsieh
pahudnet@gmail.com
@pahudnet
fb.com/pahudnet
@pahud
@pahudnet
Ad

More Related Content

What's hot (15)

Container Management with Amazon ECS
Container Management with Amazon ECSContainer Management with Amazon ECS
Container Management with Amazon ECS
AWS Germany
 
Serverless data processing with Data Pipeline
Serverless data processing with Data PipelineServerless data processing with Data Pipeline
Serverless data processing with Data Pipeline
Radek Miazio
 
AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)
Julien SIMON
 
A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
Julien SIMON
 
Serverless Computing
Serverless Computing Serverless Computing
Serverless Computing
Rushi Namani
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
Michał Kurzeja
 
Amazon ECS (December 2015)
Amazon ECS (December 2015)Amazon ECS (December 2015)
Amazon ECS (December 2015)
Julien SIMON
 
Building a Serverless Pipeline
Building a Serverless PipelineBuilding a Serverless Pipeline
Building a Serverless Pipeline
Julien SIMON
 
Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process EC...
 Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process EC... Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process EC...
Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process EC...
Julien SIMON
 
Running Docker clusters on AWS (June 2016)
Running Docker clusters on AWS (June 2016)Running Docker clusters on AWS (June 2016)
Running Docker clusters on AWS (June 2016)
Julien SIMON
 
Building a data warehouse with Amazon Redshift … and a quick look at Amazon ...
Building a data warehouse  with Amazon Redshift … and a quick look at Amazon ...Building a data warehouse  with Amazon Redshift … and a quick look at Amazon ...
Building a data warehouse with Amazon Redshift … and a quick look at Amazon ...
Julien SIMON
 
Let's Talk About Serverless - Focusing on AWS Lambda
Let's Talk About Serverless - Focusing on AWS LambdaLet's Talk About Serverless - Focusing on AWS Lambda
Let's Talk About Serverless - Focusing on AWS Lambda
Okis Chuang
 
Serverless Architecture on AWS
Serverless Architecture on AWSServerless Architecture on AWS
Serverless Architecture on AWS
Rajind Ruparathna
 
A real-life account of moving 100% to a public cloud
A real-life account of moving 100% to a public cloudA real-life account of moving 100% to a public cloud
A real-life account of moving 100% to a public cloud
Julien SIMON
 
AWS Lambda Containers - bridging the gap between serverless and containers on...
AWS Lambda Containers - bridging the gap between serverless and containers on...AWS Lambda Containers - bridging the gap between serverless and containers on...
AWS Lambda Containers - bridging the gap between serverless and containers on...
Yun Zhi Lin
 
Container Management with Amazon ECS
Container Management with Amazon ECSContainer Management with Amazon ECS
Container Management with Amazon ECS
AWS Germany
 
Serverless data processing with Data Pipeline
Serverless data processing with Data PipelineServerless data processing with Data Pipeline
Serverless data processing with Data Pipeline
Radek Miazio
 
AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)
Julien SIMON
 
A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
Julien SIMON
 
Serverless Computing
Serverless Computing Serverless Computing
Serverless Computing
Rushi Namani
 
Amazon ECS (December 2015)
Amazon ECS (December 2015)Amazon ECS (December 2015)
Amazon ECS (December 2015)
Julien SIMON
 
Building a Serverless Pipeline
Building a Serverless PipelineBuilding a Serverless Pipeline
Building a Serverless Pipeline
Julien SIMON
 
Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process EC...
 Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process EC... Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process EC...
Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process EC...
Julien SIMON
 
Running Docker clusters on AWS (June 2016)
Running Docker clusters on AWS (June 2016)Running Docker clusters on AWS (June 2016)
Running Docker clusters on AWS (June 2016)
Julien SIMON
 
Building a data warehouse with Amazon Redshift … and a quick look at Amazon ...
Building a data warehouse  with Amazon Redshift … and a quick look at Amazon ...Building a data warehouse  with Amazon Redshift … and a quick look at Amazon ...
Building a data warehouse with Amazon Redshift … and a quick look at Amazon ...
Julien SIMON
 
Let's Talk About Serverless - Focusing on AWS Lambda
Let's Talk About Serverless - Focusing on AWS LambdaLet's Talk About Serverless - Focusing on AWS Lambda
Let's Talk About Serverless - Focusing on AWS Lambda
Okis Chuang
 
Serverless Architecture on AWS
Serverless Architecture on AWSServerless Architecture on AWS
Serverless Architecture on AWS
Rajind Ruparathna
 
A real-life account of moving 100% to a public cloud
A real-life account of moving 100% to a public cloudA real-life account of moving 100% to a public cloud
A real-life account of moving 100% to a public cloud
Julien SIMON
 
AWS Lambda Containers - bridging the gap between serverless and containers on...
AWS Lambda Containers - bridging the gap between serverless and containers on...AWS Lambda Containers - bridging the gap between serverless and containers on...
AWS Lambda Containers - bridging the gap between serverless and containers on...
Yun Zhi Lin
 

Similar to 從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐 (17)

Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWS
David Mat
 
Introduction to AWS
Introduction to AWSIntroduction to AWS
Introduction to AWS
OSSCube
 
NDev Talk - Serverless Design Patterns
NDev Talk - Serverless Design PatternsNDev Talk - Serverless Design Patterns
NDev Talk - Serverless Design Patterns
Ryan Green
 
Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017
ARDC
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Steve Androulakis
 
AWS 101 - An Introduction to the Amazon Cloud
AWS 101  - An Introduction to the Amazon CloudAWS 101  - An Introduction to the Amazon Cloud
AWS 101 - An Introduction to the Amazon Cloud
CloudHesive
 
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
DataArt
 
SAP on Amazon web services
SAP on Amazon web servicesSAP on Amazon web services
SAP on Amazon web services
cloudnonstop
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Emerson Eduardo Rodrigues Von Staffen
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
aspyker
 
Cloud & Native Cloud for Managers
Cloud & Native Cloud for ManagersCloud & Native Cloud for Managers
Cloud & Native Cloud for Managers
Eitan Sela
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloud
Wayne Scarano
 
The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)
Julien SIMON
 
Grails in the Cloud (2013)
Grails in the Cloud (2013)Grails in the Cloud (2013)
Grails in the Cloud (2013)
Meni Lubetkin
 
Application Lifecycle Management and Event Driven Programming on AWS
Application Lifecycle Management and Event Driven Programming on AWSApplication Lifecycle Management and Event Driven Programming on AWS
Application Lifecycle Management and Event Driven Programming on AWS
Shiva Narayanaswamy
 
Aws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon ElishaAws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon Elisha
Helen Rogers
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
Kristana Kane
 
Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWS
David Mat
 
Introduction to AWS
Introduction to AWSIntroduction to AWS
Introduction to AWS
OSSCube
 
NDev Talk - Serverless Design Patterns
NDev Talk - Serverless Design PatternsNDev Talk - Serverless Design Patterns
NDev Talk - Serverless Design Patterns
Ryan Green
 
Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017
ARDC
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Steve Androulakis
 
AWS 101 - An Introduction to the Amazon Cloud
AWS 101  - An Introduction to the Amazon CloudAWS 101  - An Introduction to the Amazon Cloud
AWS 101 - An Introduction to the Amazon Cloud
CloudHesive
 
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
IT Talk «Microservices & Serverless Architectures», Alexander Chichenin (Solu...
DataArt
 
SAP on Amazon web services
SAP on Amazon web servicesSAP on Amazon web services
SAP on Amazon web services
cloudnonstop
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Emerson Eduardo Rodrigues Von Staffen
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
aspyker
 
Cloud & Native Cloud for Managers
Cloud & Native Cloud for ManagersCloud & Native Cloud for Managers
Cloud & Native Cloud for Managers
Eitan Sela
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloud
Wayne Scarano
 
The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)
Julien SIMON
 
Grails in the Cloud (2013)
Grails in the Cloud (2013)Grails in the Cloud (2013)
Grails in the Cloud (2013)
Meni Lubetkin
 
Application Lifecycle Management and Event Driven Programming on AWS
Application Lifecycle Management and Event Driven Programming on AWSApplication Lifecycle Management and Event Driven Programming on AWS
Application Lifecycle Management and Event Driven Programming on AWS
Shiva Narayanaswamy
 
Aws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon ElishaAws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon Elisha
Helen Rogers
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
Kristana Kane
 
Ad

Recently uploaded (19)

APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Ad

從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐

  • 2. Best Practice in AWS ECS and Serverless • Last Updated: April/19 2016 • Scheduled for 45 minutes - The Challenges - Foundational Concepts of ECS and Serverless - New Challenges - The Future • Q & A
  • 3. A Bit About Me • Both an 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 globally • AWS All-5 Certificates holder - AWS Certified Solution Architect - Associate - AWS Certified SysOps - Associate - AWS Certified Developer - Associate - AWS Certified Solution Architect - Professional - AWS Certified DevOps Engineer - Professional
  • 6. Challenges • You pay too much for EC2 instances • pay even much for micro services • Complexity in Infrastructure • VPC, subnet, routing-table, NAT, NACL, security groups, ELB, ASG • Complexity in A/B testing and B/G deployment • CFN re-deploy, EB env swap, CodePipeline/CodeDeploy, OpsWorks, etc. • complexity means error-proneness
  • 7. More Challenges • dev/testing/QA/staging/prod consistency • CI & CD challenges • even worse to manage multiple AWS regions • service decoupling means nightmares
  • 8. Questions • Can I just focus on my service stack unit, instead of computing unit(EC2) ? • Self-Healing, Auto-Scaling, AZ-balancing ? • Log Consolidation ? • Immutable and Stateless Architecture ? • Cost Optimization and Resource Optimization ? • still having full control on my tech stack (frameworks and languages) • simple deployment, A/B and B/G ?
  • 9. a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster of Amazon EC2 instances. AWS EC2 Container Service
  • 10. ECS Cluster ASG on demand ASG spot instance CloudWatch
  • 11. Auto Scaling Policy Design • scale out spot on 30%-60% • scale out on-demand when >= 60% • scale in on-demand when <60% • scale in spot when <=30% • with minimal 1 on-demand or RI
  • 12. Simply Put • on-demand/RI 打底 spot伸縮 • on-demand scale out last, scale in first • try spot fleet if you need couples of instances( lets talk about it next time )
  • 13. external ELB internal ELB instance * 2 web * 2 app * 2 worker* 2 instance * 4 SQS CloudWatch web * 4
  • 14. Benefits and Tips • Leverage ELB to build micro-services • Monitor service loading by CloudWatch and adjust spot fleet to scale out/in services/tasks dynamically • Self-healing in container level • Fully-managed deployment and rolling update with revisions • Better resource utilization • Consolidate application logs to CloudWatch Logs • Create filter, metrics and build alarms from CloudWatch Logs • Push your docker images to ECR and deploy across regions with exactly the same image
  • 15. What if 20-30 micro services?
  • 16. ECS Service Load Balancing docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balanc
  • 17. Random ports LB and Service Discovery?
  • 18. Load Balancing on Random Ports http://www.slideshare.net/JulienSIMON5/amazon-ecs-january-2016/12
  • 19. Meteor Galaxy session-aware with random ports share.net/AmazonWebServices/dvo313-building-nextgeneration-applications-w
  • 20. Is there a way to move the code in a cloud native way?
  • 21. “No server is easier to manage than no server” - Werner Vogels, Amazon CTO AWS re:Invent 2015
  • 22. AWS Lambda AWS API Gateway “a compute service where you can upload your code to AWS Lambda and the service can run the code on your behalf using AWS infrastructure” “a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale”
  • 28. API Gateway Lambda function Integration RESTful API HTTP PUT /items/123 {“foo”:”bar”} event.param_id=123 event.http_body={“foo”:”bar”}
  • 29. API Gateway Service Proxy Integration RESTful API IAM assume role execution
  • 31. Pros • cloud native with your business code in Lambda • no infrastructure to manage • leverage AWS PaaS infrastructure at scale • custom or federated authorization • very minimal cost for small-medium teams - 30m requests = $11.63 per month (Lambda) - $4.25 per million requests(API Gateway)
  • 33. Cons - Lambda Limit • Lambda soft limit concurrency is 100 • 300 seconds max duration per invocation • Lambda in VPC restriction - private IP addresses - ENIC limit(default 20*5=100)
  • 34. Cons - API Gateway • 500-1000 QPS per AWS Account • 5M requests / month = $18.79 • 100 QPS = $974.07 / month = 31,350NTD • No async or parallel invocation with Lambda
  • 35. Cons - Performance • push and pull invocation model of Lambda • -> delegation with higher memory • no connection pooling • -> always open/close conn in handler scope
  • 36. Cons - Development • CloudWatch debugging • immature CI/CD toolchains • lack of PHP, Ruby and Golang • re-deploy the whole bundle could be a pain
  • 37. When should I use ECS, instead of serverless?
  • 38. Use ECS • financial concern - When you have traffic more than 100QPS+ • operation concern - Long running process or API service • language concern - Golang, PHP, Ruby, etc. • performance concern - need really big memory or CPU- optimized • protocol concern - websockets, MQTT, other TCP protocols
  • 39. Use Serverless • small project, simple business logic • focus on the code only • no infrastructure management • stateless • quick micro services implementation • simply integrated with other AWS services - i.e. API Gateway update DynamoDB, Kinesis, SQS as service proxy.
  • 40. Conclusions • containerize your stack, and try serverless as much as you can • build stateless application • immutable architecture - every computing component can be replaced and scaled with no impact • focus on your business logic, instead of the infrastructure, forget your infrastructure • try not use any EC2, if necessary, avoid SSH into EC2 for manual operation • fully-managed and fully-automation is the way to go • embrace event-driven cloud computing
  • 41. See You Next Time
  • 42. Your Success Is Our Success