SlideShare a Scribd company logo
Lessons learnt from Guanyu
-- ECS, Autoscaling, and Architecture
Cliff Chao-kuan Lu
呂昭寬 AWSUGTW
<clifflu@gmail.com>
Image by NASA JPL via Space Images
Agenda
• Cliff
• Guanyu
• Future
Cliff Chao-kuan Lu 呂昭寬
• Sr. Architect @ 104 Corp., #1 Job Bank in Taiwan
• Organizer to AWS User Group Taiwan
• AWS Community Hero
• Certified ALL-5 + Big Data
Guanyu
• Home-made security service on top of
Sophos AV and AWS ECS
• 6-9M scans per month at $100-200
• Developed June-August 2016
Architecture
POST
/scan/file
ALB
ECS
Response
Handler ParserSophos AV
Cache
DynamoDB
Architecture
POST
/scan/uri
ALB
ECS
Response
Fetch Cleanup
DynamoDB
Han
dler
Pa
rs
er
Sop
hos
AV
Cache
Architecture
POST
/scan/text
ALB
ECS
Response
DynamoDB
Fet
ch
Clea
nup
H
a
n
dl
e
r
P
a
r
s
e
r
So
ph
os
A
V
Cache
ScanUri
Architecture, In Short
• Node.js web project + Sophos-AV in 1 image
•Monolithic
Container Footprint
• At rest
• CPU: Minimal
• Memory: ~30mb
• Scanning
• CPU: ~50% (single core)
• Memory: ~300mb
• Default: 4 parallel scans
• Cache Hit
• CPU: Minimal
• Memory: ~30mb
Auto Scaling, Ideally
Auto Scaling, NOT Ideal
?
Dilemma - Resource Availability
• Starting EC2 instances takes time
• Buffer with %Unreserved
• Upper bound to %Reserved
Taking Spot Instance into Play
• Takes longer to instantiate
• Not always available
• Lower price
• Targets 50% reserved
• Dual ASG (Spot + On-
Demand)
Dilemma - Allocation / Utilization
Gotcha: Overshoot
• Longer boot-up time means more buffer required
• Metrics reflects PAST status
• Grew to 17 when we needed 4
• Tuning complex scaling policies is an Art
Yeah, Art
Planned Scan Engines
• Malware
• Sophos AV
• BinaryAlert
https://www.binaryalert.io/
• Inappropriate Images
• AWS Rekognition
• OpenNSFW
https://github.com/yahoo/open_nsfw
Proposed Architecture
POST
/scan/*
ALB
ECS
Response
Handler
Cache
DynamoDB
SNSSQS
ParserSophos AV
ParserOpenNSFW
Lambda
Advantages
• Uniform workloads is easier to manage
• Synchronous -> Asynchronous
• Allows higher %Reserved
• Do more, cost less
Better Late than Never
Take Home Message
• Spot instance offers great performance per dollar
• Mind the platform gap
• Never too late to refactor
• Keep an eye on Auto Scaling
• Balance availability, cost, and performance
QUESTIONS
Thank You
SEE YOU NEXT YEAR!

More Related Content

PPTX
Introduction to Terraform with Azure flavor
PDF
Go Serverless with Java and Azure Functions
PPTX
Operational challenges behind Serverless architectures
PDF
DevOps in real life
PPTX
Autoscaling near-persistent EBS
PDF
Inrastructure as Code
PPTX
Using Terraform for AWS as the IaC tool
PPTX
Infrastructure Automation on AWS using a Real-World Customer Example
Introduction to Terraform with Azure flavor
Go Serverless with Java and Azure Functions
Operational challenges behind Serverless architectures
DevOps in real life
Autoscaling near-persistent EBS
Inrastructure as Code
Using Terraform for AWS as the IaC tool
Infrastructure Automation on AWS using a Real-World Customer Example

What's hot (14)

PPTX
Getting started with Laravel & Elasticsearch
PDF
Terraform
PPTX
Laravel and SOLR
PPTX
Infrastructure as code (iac) - Terraform for AWS
PPT
DevOpsCon Cloud Workshop
PDF
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
PPTX
Meetup #3: Migrate a fast scale system to AWS
PPTX
Campus days Azure HDInsight automation
PDF
Atlantisで実現するTerraformのGitOps
PDF
AWS re:Invent 2016 Fast Forward
PDF
Scaling WordPress - WP on AWS
PPTX
Sas 2015 event_driven
PPT
Beyond Heroku: Hosting Your Rails App Yourself
PPTX
Tech Week London 2017
Getting started with Laravel & Elasticsearch
Terraform
Laravel and SOLR
Infrastructure as code (iac) - Terraform for AWS
DevOpsCon Cloud Workshop
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Meetup #3: Migrate a fast scale system to AWS
Campus days Azure HDInsight automation
Atlantisで実現するTerraformのGitOps
AWS re:Invent 2016 Fast Forward
Scaling WordPress - WP on AWS
Sas 2015 event_driven
Beyond Heroku: Hosting Your Rails App Yourself
Tech Week London 2017
Ad

Similar to Lessons Learnt from Guanyu (20)

PDF
Migrating to aws
PPTX
Migrating enterprise workloads to AWS
PPTX
Cost Effectively Run Multiple Oracle Database Copies at Scale
PDF
Using JCache to speed up your apps
PDF
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
PPTX
Journey Towards Scaling Your Application to Million Users
PPTX
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
PDF
Dean Bryen: Scaling The Platform For Your Startup
PDF
Ceph Goes on Online at Qihoo 360 - Xuehan Xu
PDF
NLUUG print conference May 26 2016
PDF
[OpenInfra Days Korea 2018] Day 2 - E5-1: "Invited Talk: Kubicorn - Building ...
PDF
Openstackoverview-DEC2013
PDF
16 months @ SoundCloud
PPTX
Project RedDwarf - Database Services in the Cloud.pptx
PPTX
Greetings from AWS User Group Taiwan
PPTX
Moving to the Cloud: AWS, Zend, RightScale
PPTX
OpenStack 101
PPTX
OpenStack 101 - All Things Open 2015
PDF
The Netflix Open Source Platform
PDF
SV Forum Platform Architecture SIG - Netflix Open Source Platform
Migrating to aws
Migrating enterprise workloads to AWS
Cost Effectively Run Multiple Oracle Database Copies at Scale
Using JCache to speed up your apps
FOSS4G In The Cloud: Using Open Source to build Cloud based Spatial Infrastru...
Journey Towards Scaling Your Application to Million Users
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
Dean Bryen: Scaling The Platform For Your Startup
Ceph Goes on Online at Qihoo 360 - Xuehan Xu
NLUUG print conference May 26 2016
[OpenInfra Days Korea 2018] Day 2 - E5-1: "Invited Talk: Kubicorn - Building ...
Openstackoverview-DEC2013
16 months @ SoundCloud
Project RedDwarf - Database Services in the Cloud.pptx
Greetings from AWS User Group Taiwan
Moving to the Cloud: AWS, Zend, RightScale
OpenStack 101
OpenStack 101 - All Things Open 2015
The Netflix Open Source Platform
SV Forum Platform Architecture SIG - Netflix Open Source Platform
Ad

More from Cliff Chao-kuan Lu (13)

PPTX
EC2 Spot in 104
PPTX
Serverless 網站監控
PPTX
Serverless Patterns
PPTX
104 meets cloud
PDF
Intro to Serverless
PPTX
Interview Quiz w/o Server
PPTX
那些 re:Invent 不怎麼技術的事
PPTX
Cost Optimization Best Practices from Trend Micro
PPTX
不談 IAM
PPTX
Networking in the cloud
PPTX
Health, Platform, In The Cloud
PPTX
AWS Solutions Architect 準備心得
PPTX
無障礙網頁
EC2 Spot in 104
Serverless 網站監控
Serverless Patterns
104 meets cloud
Intro to Serverless
Interview Quiz w/o Server
那些 re:Invent 不怎麼技術的事
Cost Optimization Best Practices from Trend Micro
不談 IAM
Networking in the cloud
Health, Platform, In The Cloud
AWS Solutions Architect 準備心得
無障礙網頁

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Spectroscopy.pptx food analysis technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Machine Learning_overview_presentation.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
A Presentation on Artificial Intelligence
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
NewMind AI Weekly Chronicles - August'25-Week II
Spectroscopy.pptx food analysis technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Machine Learning_overview_presentation.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
MYSQL Presentation for SQL database connectivity
Assigned Numbers - 2025 - Bluetooth® Document
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Lessons Learnt from Guanyu

Editor's Notes

  • #5: Developed in ‘16 in response to security event that exploited us as vector
  • #15: Reserve according to the worst. Allocate less, and you’re at risk. Reservation targeted at 30-50%, utilization ~ 1-10%.