SlideShare una empresa de Scribd logo
1 de 60
Scaling to Millions of Users in the
Blink of an Eye with Amazon
CloudFront: Are you Ready?
April 25, 2017
Nihar Bihani
Sr. Manager, Product Management, Amazon CloudFront
@cloudfront
Could this be you?
• Have you had to prepare for a big online event (launch,
announcement, presentation)?
• Have you had a surprise surge in traffic you didn’t
expect?
• Has there been outages or performance issues related
to these traffic spikes?
@cloudfront
Today’s session
• (A) Understand the types of events that could cause
large traffic spikes
• (B) Learn how CloudFront helps with these challenges
• (C) Review CloudFront best practices to further
prepare for large scale events
@cloudfront
(A) Understand the types
of events that could
cause large traffic spikes
@cloudfront
Type #1: Anticipated surge
• New product launch or a marketing promotion
• Live broadcast
• Partner conducts a “load test”
@cloudfront
Type #2: Going viral
• Article picked up by major news outlet
• Twitter pickup
• Social media campaign has larger impact than
anticipated
@cloudfront
Type #3: Undesired traffic
• Application DDoS
• Bots & Scrapers
@cloudfront
But if we don’t anticipate the
traffic, how do we plan for it?
@cloudfront
Regardless of type
• Preparation is independent of cause
• Most common failure points are incorrect caching
policies and an unscaled origin
@cloudfront
25,000 RPS
25,000 RPS
25,000 RPS
25,000 RPS
5,000 Mbps
5,000 Mbps
5,000 Mbps
5,000 Mbps
Network
Hosts
Clients Clients
Typical architecture
@cloudfront
Impact of flash crowds
• High request rates happen faster than application
scales, creating 500-series errors
• High data transfer volume saturates network interfaces,
increasing retransmits and “browning out” the network
Not only will latency be increased, but some users won’t
get any content at all!
@cloudfront
Poll
Have you experienced an outage or
a performance issue due to a large
traffic spike to your application?
(B) Learn how CloudFront
helps with these challenges
@cloudfront
Level Set: What is a CDN and Why Use One?
• Content Delivery Network
• Large Distribution of Caching Servers
• Routes Viewers to the Best Location
• Caches Appropriate Content at the Edge
• Accelerates Dynamic Content
• Provides Security, Scalability and Performance of Applications
@cloudfront
Amazon CloudFront
• Global Content Delivery Network with Massive Capacity
• Optimized for Performance and Scale
• Built in Security Features
• Self-Service, Full Control Configurations
• Real-Time Metrics & Alarms
• Static and Dynamic Object and Video Delivery
Amazon
CloudFront
@cloudfront
Dynamic
Static
Video
User
Input
SSL
Amazon CloudFront: Whole Site Delivery
@cloudfront
Elastic Load
Balancing
Dynamic Content
Amazon EC2
Static Content
Amazon S3 Custom Origin
OR
OR
Custom Origin
Amazon CloudFront
example.com
*.jpg
*.php
Accelerate ALL Types of Content
@cloudfront
How CloudFront helps…
@cloudfront
#1 - Global Content Delivery Network
North America
Cities: 19
PoPs: 26
South America
Cities: 2
PoPs: 3
Rio de Janeiro, Brazil (2)
São Paulo, Brazil
Europe / Middle East / Africa
Cities: 15
PoPs: 24
Amsterdam, The Netherlands (2)
Berlin, Germany
Dublin, Ireland
Frankfurt, Germany (5)
London, England (4)
Madrid, Spain
Marseille, France
Milan, Italy
Munich, Germany
Paris, France (2)
Prague, Czech Republic
Stockholm, Sweden
Vienna, Austria
Warsaw, Poland
Zurich, Switzerland
Ashburn, VA (3)
Atlanta, GA (3)
Chicago, IL
Dallas/Fort Worth, TX (2)
Hayward, CA
Jacksonville, FL
Los Angeles, CA (2)
Miami, FL
Minneapolis, MN
Montreal, QC
Newark, NJ
New York, NY (3)
Palo Alto, CA
Philadelphia, PA
San Jose, CA
Seattle, WA
South Bend, IN
St. Louis, MO
Toronto, ON
CloudFront Regional Edge Caches
Regional Edge Caches: 11
Oregon, N. Virginia, Ohio, Frankfurt,
London, Sao Paulo, Mumbai, Singapore,
Seoul, Tokyo, Sydney
74 CloudFront Edge Locations (PoPs), 11 Regional Edge Caches (PoPs), 48 Cities, 5 Continents
Edge
location
AWS Region /
Regional Edge Cache
Regional Edge
Cache
Asia Pacific
Cities: 12
PoPs: 20
Chennai, India
Hong Kong, China (3)
Manila, the Philippines
Melbourne, Australia
Mumbai, India (2)
New Delhi, India
Osaka, Japan
Seoul, Korea (3)
Singapore (2)
Sydney, Australia
Taipei, Taiwan
Tokyo, Japan (3)
Latency Based Routing
• What matters to customers is end-user latency
• Continuously learn latency distance from billions of real user
measurements
@cloudfront
Singapore
DNS Resolver
Singapore
TCP Connect 1.2.3.4
HTTP/1.1
GET /example.jpg
DNS response
d123.cloudfront.net
1.2.3.4
DNS query
d123.cloudfront.net
Routing Engine Maps
Resolvers/Viewer Networks =>
Edge Location
Tokyo
1.2.3.4
Anonymous Latency
measurements from real
users
Support for EDNS0 Client Subnet
• Client-subnet extension to DNS allows a portion of the
viewer's IP address to be supplied in DNS requests
• Map viewer networks to optimal edge locations
@cloudfront
CloudFront Regional Edge Caches
Europe
Frankfurt, Germany
London, EnglandNorth America
N Virginia,
Oregon,
Ohio
Asia Pacific
Mumbai, India
Singapore
Sydney, Australia
Seoul, South Korea
Tokyo, Japan
South America
São Paulo, Brazil
11 Regional Edge Caches around the world..
@cloudfront
CloudFront Regional Edge Caches
Origin
Regional Edge Cache
Reducing load on CloudFront origin resources
Origin
Edge Locations
Previous Architecture New Default Architecture
@cloudfront
#2 – Built-In Content Optimizations
 Collapse multiple requests for the same object back to the
origin
 Serve stale content when origin is unavailable
 Video optimizations for Smooth Streaming
@cloudfront
#3 – Default Network Optimizations
 TCP Window Scaling & Persistent TCP Connections to
reduce Round-Trip Time
 Amazon Global network
@cloudfront
#4 – End-to-End Security
 HTTPS delivery with SSL/TLS termination close to viewers
 High security ciphers
 Perfect Forward Secrecy
 TCP Fast Open
 Caching Session Tickets
 Online Certificate Status Protocol (OCSP) Stapling
@cloudfront
edge
location
Origin
User Request A
Pop Quiz
Are there performance benefits in
delivering dynamic content via
CloudFront?
(C) CloudFront best
practices to further prepare
for large scale events
@cloudfront
#1
Use Caching
@cloudfront
Use caching up and down the stack
• Database access: Amazon ElastiCache
• Origin web tier: Squid/Varnish/Nginx
• Edge: Amazon CloudFront
• Browser
@cloudfront
Caching protects servers
2,500 RPS
Network
Hosts
Clients Clients
Cache
2,500
RPS
2,500 RPS
2,500
RPS
Cache
Caching protects network
500 Mbps
Network
Hosts
Clients Clients
Cache
500
Mbps
500 Mbps
500
Mbps
Cache
@cloudfront
Browser Caching
• Set max-age or expiry date in your headers
(e.g. Cache-Control: max-age=3600)
• HTML5 application cache
• Helps eliminate network latency
• But… browser cache size is limited
(e.g. IE is 8-50M, Chrome is < 80M, Firefox is 50MB, etc.)
@cloudfront
CloudFront Edge Caching
• Set High TTLs for intermediary caches
(e.g. Cache-Control: max-age=3600, s-maxage=86400)
• Don’t forward Headers, Query Strings or Cookies
Note: You do need to forward the relevant headers if you’re doing CORS
• In other words, use CloudFront defaults
@cloudfront
#2
Cache everything Possible
(including Dynamic Content)
@cloudfront
Cache Everything Possible
CloudFront supports TTLs as low as 0 seconds, no-cache, no-
store, etc.
Most content can be cached, even if it is for a few seconds
Benefits of setting a low TTL
• CloudFront supports “If-Modified-Since” and “If-None-Match” when object in the cache has
expired
• CloudFront will serve stale content if origin is unavailable and object is in cache
• Helps you offload your origin load
@cloudfront
#3
Use multiple cache behaviors
@cloudfront
Use Multiple Cache Behaviors
ONLY forward required headers
• Example: don’t forward cookies for /images
Avoid forwarding the User-Agent header
• Instead use the Is-Mobile-Viewer, Is-Tablet-Viewer, Is-Desktop-Viewer, or Is-SmartTV-Viewer header values
Avoid forwarding ALL cookies
• Instead, forward only the select cookies that you use to vary your content
@cloudfront
#4
Optimize the end-to-end
Network Path
@cloudfront
Use HTTP/2 and Configure Keep-Alive Timeout
• Enable HTTP/2 between CloudFront and Clients. HTTP/2 is a
major revision of the HTTP protocol and uses several features to
make page loading and rendering faster:
− Multiplexing: allows multiple requests between client and CloudFront at the same time
over a single connection
− Header compression: Reduces overhead bytes downloaded by client, especially useful
for mobile clients
− Stream priority: Enables client to control order in which web assets are delivered
• Keep Alive Timeout. You can now configure the maximum time that
CloudFront will maintain an idle connection with a custom origin
server before closing it.
@cloudfront
#5
Scale your origin
@cloudfront
Using Auto Scaling effectively
in web applications
@cloudfront
#6
Let your origin do only the
work it needs to do
@cloudfront
Use Amazon S3 for Static Assets
• Free data transfer from Amazon S3 to CloudFront
• Decrease load on web server
• Highly available & scalable
@cloudfront
Pop Quiz
Can you run custom compute at a
CloudFront location?
Use Lambda@Edge
• Lambda@Edge is an extension of AWS Lambda that allows you to run
Node.js code at AWS global edge locations.
• Bring your own code to the edge and customize your content very close to
your users, improving the end-user experience.
Continuous
scaling
No servers
to manage
Never pay for idle
– no cold servers
Globally
distributed
@cloudfront
Sign up for preview: https://pages.awscloud.com/lambda-at-edge-preview.html
CloudFront Triggers for
Lambda@Edge Functions
@cloudfront
• User Properties – Identify a user’s location
• Client Device properties - Delete or modify
headers
• A/B Testing - “Flip a coin” to select a version of
content
• Ad content - Rewrite URLs
• Pretty URLs – Avoid revealing your origin
directory structure
Content Customization
@cloudfront
Visitor Validation
• Handling bots
• Detect search engine bots and filter traffic
• Confirm valid sessions
• View user-agent to confirm legitimacy of
request
@cloudfront
#7
Configure Custom Error
Pages
@cloudfront
Always Configure Custom Error Pages
Custom error pages help improve
customer experience
Deliver error pages from Amazon
S3
Set low error caching minimum
TTL (e.g. 15 seconds)
@cloudfront
Poll
Have you looked into securing your
cloud infrastructure at the edge?
#8
Use AWS WAF
@cloudfront
What is AWS WAF
@cloudfront
https://aws.amazon.com/waf/
HTTP floods
Scanners and probes
SQL injection
Bots and scrapers
IP reputation lists
Cross-site scripting
Preconfigured Protection
@cloudfront
CloudFront: How To Get Started
@cloudfront
CloudFront Getting Started
CloudFront Free Tier
@cloudfront
Using Amazon S3?
CloudFront Developer Guide: Using
CloudFront with Amazon S3
Using Elastic Load Balancing?
https://aws.amazon.com/cloudfront/webi
nars/#slack-video
Upcoming Amazon CloudFront Office Hours
CloudFront Office Hours
Thursday, April 27th, 2017 10:00 am PDT
How do you register?
https://aws.amazon.com/cloudfront/events/
@cloudfront
Questions?
@cloudfront
Thank You
@cloudfront
https://aws.amazon.com/cloudfront/getting-started/

Más contenido relacionado

La actualidad más candente

Designing Event-Driven Applications with Apache NiFi, Apache Flink, Apache Sp...
Designing Event-Driven Applications with Apache NiFi, Apache Flink, Apache Sp...Designing Event-Driven Applications with Apache NiFi, Apache Flink, Apache Sp...
Designing Event-Driven Applications with Apache NiFi, Apache Flink, Apache Sp...
Timothy Spann
 

La actualidad más candente (20)

Overview of microsoft teams
Overview of microsoft teamsOverview of microsoft teams
Overview of microsoft teams
 
Getting Started with AWS Compute Services
Getting Started with AWS Compute ServicesGetting Started with AWS Compute Services
Getting Started with AWS Compute Services
 
Introduction to Time Series Analytics with Microsoft Azure
Introduction to Time Series Analytics with Microsoft AzureIntroduction to Time Series Analytics with Microsoft Azure
Introduction to Time Series Analytics with Microsoft Azure
 
VMware on AWS A Technical Deep Dive PPT
VMware on AWS A Technical Deep Dive PPTVMware on AWS A Technical Deep Dive PPT
VMware on AWS A Technical Deep Dive PPT
 
Amazon CloudFront 101
Amazon CloudFront 101Amazon CloudFront 101
Amazon CloudFront 101
 
AWS Webcast - Introduction to AWS Support Services
AWS Webcast - Introduction to AWS Support ServicesAWS Webcast - Introduction to AWS Support Services
AWS Webcast - Introduction to AWS Support Services
 
How Organizations Can Prepare for Microsoft Viva
How Organizations Can Prepare for Microsoft VivaHow Organizations Can Prepare for Microsoft Viva
How Organizations Can Prepare for Microsoft Viva
 
Designing Event-Driven Applications with Apache NiFi, Apache Flink, Apache Sp...
Designing Event-Driven Applications with Apache NiFi, Apache Flink, Apache Sp...Designing Event-Driven Applications with Apache NiFi, Apache Flink, Apache Sp...
Designing Event-Driven Applications with Apache NiFi, Apache Flink, Apache Sp...
 
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
 
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
 
Next Gen Innovation: Enhancing your Contact Center with Amazon Connect for t...
Next Gen Innovation:  Enhancing your Contact Center with Amazon Connect for t...Next Gen Innovation:  Enhancing your Contact Center with Amazon Connect for t...
Next Gen Innovation: Enhancing your Contact Center with Amazon Connect for t...
 
AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019
 
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic BeanstalkDeploy, Scale and Manage your Application with AWS Elastic Beanstalk
Deploy, Scale and Manage your Application with AWS Elastic Beanstalk
 
[2017 Windows on AWS] AWS 를 활용한 Active Directory 연동 및 이관 방안
[2017 Windows on AWS] AWS 를 활용한 Active Directory 연동 및 이관 방안[2017 Windows on AWS] AWS 를 활용한 Active Directory 연동 및 이관 방안
[2017 Windows on AWS] AWS 를 활용한 Active Directory 연동 및 이관 방안
 
Getting Started with Amazon WorkSpaces
 Getting Started with Amazon WorkSpaces Getting Started with Amazon WorkSpaces
Getting Started with Amazon WorkSpaces
 
Amazon QuickSight
Amazon QuickSightAmazon QuickSight
Amazon QuickSight
 
How to Get Your Organizations To Start Using Microsoft Teams
How to Get Your Organizations To Start Using Microsoft TeamsHow to Get Your Organizations To Start Using Microsoft Teams
How to Get Your Organizations To Start Using Microsoft Teams
 
CloudFormation Best Practices
CloudFormation Best PracticesCloudFormation Best Practices
CloudFormation Best Practices
 
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
Amazon RDS & Amazon Aurora: Relational Databases on AWS - SRV206 - Atlanta AW...
 
(BDT208) A Technical Introduction to Amazon Elastic MapReduce
(BDT208) A Technical Introduction to Amazon Elastic MapReduce(BDT208) A Technical Introduction to Amazon Elastic MapReduce
(BDT208) A Technical Introduction to Amazon Elastic MapReduce
 

Similar a Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online Tech Talks

AWS 201 - A Walk through the AWS Cloud: Introduction to Amazon CloudFront
AWS 201 - A Walk through the AWS Cloud: Introduction to Amazon CloudFrontAWS 201 - A Walk through the AWS Cloud: Introduction to Amazon CloudFront
AWS 201 - A Walk through the AWS Cloud: Introduction to Amazon CloudFront
Amazon Web Services
 
Unconference Round Table Notes
Unconference Round Table NotesUnconference Round Table Notes
Unconference Round Table Notes
Timothy Spann
 
AWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWSAWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWS
Amazon Web Services
 
Best practices for content delivery using amazon cloud front
Best practices for content delivery using amazon cloud frontBest practices for content delivery using amazon cloud front
Best practices for content delivery using amazon cloud front
Amazon Web Services
 

Similar a Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online Tech Talks (20)

[AWS에서의 미디어 및 엔터테인먼트] 클라우드에서의 브로드캐스팅 서비스
[AWS에서의 미디어 및 엔터테인먼트] 클라우드에서의 브로드캐스팅 서비스[AWS에서의 미디어 및 엔터테인먼트] 클라우드에서의 브로드캐스팅 서비스
[AWS에서의 미디어 및 엔터테인먼트] 클라우드에서의 브로드캐스팅 서비스
 
AWS 201 - A Walk through the AWS Cloud: Introduction to Amazon CloudFront
AWS 201 - A Walk through the AWS Cloud: Introduction to Amazon CloudFrontAWS 201 - A Walk through the AWS Cloud: Introduction to Amazon CloudFront
AWS 201 - A Walk through the AWS Cloud: Introduction to Amazon CloudFront
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
AWS Cloudfront Fundamentals
AWS Cloudfront FundamentalsAWS Cloudfront Fundamentals
AWS Cloudfront Fundamentals
 
Unconference Round Table Notes
Unconference Round Table NotesUnconference Round Table Notes
Unconference Round Table Notes
 
AWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWSAWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWS
 
AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)
 
Don’t Sacrifice Performance for Security: Best Practices for Content Delivery
Don’t Sacrifice Performance for Security: Best Practices for Content Delivery Don’t Sacrifice Performance for Security: Best Practices for Content Delivery
Don’t Sacrifice Performance for Security: Best Practices for Content Delivery
 
Amazon CloudFront Complete with Blazeclan's Media Solution Stack
Amazon CloudFront Complete with Blazeclan's Media Solution StackAmazon CloudFront Complete with Blazeclan's Media Solution Stack
Amazon CloudFront Complete with Blazeclan's Media Solution Stack
 
AWS re:Invent 2016: Discovery Channel's Broadcast Workflows and Channel Origi...
AWS re:Invent 2016: Discovery Channel's Broadcast Workflows and Channel Origi...AWS re:Invent 2016: Discovery Channel's Broadcast Workflows and Channel Origi...
AWS re:Invent 2016: Discovery Channel's Broadcast Workflows and Channel Origi...
 
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
 
Migration Recipes for Success - AWS Summit Cape Town 2017
Migration Recipes for Success - AWS Summit Cape Town 2017 Migration Recipes for Success - AWS Summit Cape Town 2017
Migration Recipes for Success - AWS Summit Cape Town 2017
 
WIN401_Migrating Microsoft Applications to AWS
WIN401_Migrating Microsoft Applications to AWSWIN401_Migrating Microsoft Applications to AWS
WIN401_Migrating Microsoft Applications to AWS
 
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
 
CloudFront 소개 및 데모 – 이수형 수석 (Solutions Architect), 아마존웹서비스코리아
CloudFront 소개 및 데모 – 이수형 수석 (Solutions Architect), 아마존웹서비스코리아CloudFront 소개 및 데모 – 이수형 수석 (Solutions Architect), 아마존웹서비스코리아
CloudFront 소개 및 데모 – 이수형 수석 (Solutions Architect), 아마존웹서비스코리아
 
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFront
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFrontAWS Webcast - Best Practices for Content Delivery using Amazon CloudFront
AWS Webcast - Best Practices for Content Delivery using Amazon CloudFront
 
Best practices for content delivery using amazon cloud front
Best practices for content delivery using amazon cloud frontBest practices for content delivery using amazon cloud front
Best practices for content delivery using amazon cloud front
 
Neev cloud services with AWS
Neev cloud services with AWSNeev cloud services with AWS
Neev cloud services with AWS
 
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
 
AWS re:Invent 2016: Workshop: Migrating Microsoft Applications to AWS (ENT216)
AWS re:Invent 2016: Workshop: Migrating Microsoft Applications to AWS (ENT216)AWS re:Invent 2016: Workshop: Migrating Microsoft Applications to AWS (ENT216)
AWS re:Invent 2016: Workshop: Migrating Microsoft Applications to AWS (ENT216)
 

Más de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online Tech Talks

  • 1. Scaling to Millions of Users in the Blink of an Eye with Amazon CloudFront: Are you Ready? April 25, 2017 Nihar Bihani Sr. Manager, Product Management, Amazon CloudFront @cloudfront
  • 2. Could this be you? • Have you had to prepare for a big online event (launch, announcement, presentation)? • Have you had a surprise surge in traffic you didn’t expect? • Has there been outages or performance issues related to these traffic spikes? @cloudfront
  • 3. Today’s session • (A) Understand the types of events that could cause large traffic spikes • (B) Learn how CloudFront helps with these challenges • (C) Review CloudFront best practices to further prepare for large scale events @cloudfront
  • 4. (A) Understand the types of events that could cause large traffic spikes @cloudfront
  • 5. Type #1: Anticipated surge • New product launch or a marketing promotion • Live broadcast • Partner conducts a “load test” @cloudfront
  • 6. Type #2: Going viral • Article picked up by major news outlet • Twitter pickup • Social media campaign has larger impact than anticipated @cloudfront
  • 7. Type #3: Undesired traffic • Application DDoS • Bots & Scrapers @cloudfront
  • 8. But if we don’t anticipate the traffic, how do we plan for it? @cloudfront
  • 9. Regardless of type • Preparation is independent of cause • Most common failure points are incorrect caching policies and an unscaled origin @cloudfront
  • 10. 25,000 RPS 25,000 RPS 25,000 RPS 25,000 RPS 5,000 Mbps 5,000 Mbps 5,000 Mbps 5,000 Mbps Network Hosts Clients Clients Typical architecture @cloudfront
  • 11. Impact of flash crowds • High request rates happen faster than application scales, creating 500-series errors • High data transfer volume saturates network interfaces, increasing retransmits and “browning out” the network Not only will latency be increased, but some users won’t get any content at all! @cloudfront
  • 12. Poll Have you experienced an outage or a performance issue due to a large traffic spike to your application?
  • 13. (B) Learn how CloudFront helps with these challenges @cloudfront
  • 14. Level Set: What is a CDN and Why Use One? • Content Delivery Network • Large Distribution of Caching Servers • Routes Viewers to the Best Location • Caches Appropriate Content at the Edge • Accelerates Dynamic Content • Provides Security, Scalability and Performance of Applications @cloudfront
  • 15. Amazon CloudFront • Global Content Delivery Network with Massive Capacity • Optimized for Performance and Scale • Built in Security Features • Self-Service, Full Control Configurations • Real-Time Metrics & Alarms • Static and Dynamic Object and Video Delivery Amazon CloudFront @cloudfront
  • 17. Elastic Load Balancing Dynamic Content Amazon EC2 Static Content Amazon S3 Custom Origin OR OR Custom Origin Amazon CloudFront example.com *.jpg *.php Accelerate ALL Types of Content @cloudfront
  • 19. #1 - Global Content Delivery Network North America Cities: 19 PoPs: 26 South America Cities: 2 PoPs: 3 Rio de Janeiro, Brazil (2) São Paulo, Brazil Europe / Middle East / Africa Cities: 15 PoPs: 24 Amsterdam, The Netherlands (2) Berlin, Germany Dublin, Ireland Frankfurt, Germany (5) London, England (4) Madrid, Spain Marseille, France Milan, Italy Munich, Germany Paris, France (2) Prague, Czech Republic Stockholm, Sweden Vienna, Austria Warsaw, Poland Zurich, Switzerland Ashburn, VA (3) Atlanta, GA (3) Chicago, IL Dallas/Fort Worth, TX (2) Hayward, CA Jacksonville, FL Los Angeles, CA (2) Miami, FL Minneapolis, MN Montreal, QC Newark, NJ New York, NY (3) Palo Alto, CA Philadelphia, PA San Jose, CA Seattle, WA South Bend, IN St. Louis, MO Toronto, ON CloudFront Regional Edge Caches Regional Edge Caches: 11 Oregon, N. Virginia, Ohio, Frankfurt, London, Sao Paulo, Mumbai, Singapore, Seoul, Tokyo, Sydney 74 CloudFront Edge Locations (PoPs), 11 Regional Edge Caches (PoPs), 48 Cities, 5 Continents Edge location AWS Region / Regional Edge Cache Regional Edge Cache Asia Pacific Cities: 12 PoPs: 20 Chennai, India Hong Kong, China (3) Manila, the Philippines Melbourne, Australia Mumbai, India (2) New Delhi, India Osaka, Japan Seoul, Korea (3) Singapore (2) Sydney, Australia Taipei, Taiwan Tokyo, Japan (3)
  • 20. Latency Based Routing • What matters to customers is end-user latency • Continuously learn latency distance from billions of real user measurements @cloudfront Singapore DNS Resolver Singapore TCP Connect 1.2.3.4 HTTP/1.1 GET /example.jpg DNS response d123.cloudfront.net 1.2.3.4 DNS query d123.cloudfront.net Routing Engine Maps Resolvers/Viewer Networks => Edge Location Tokyo 1.2.3.4 Anonymous Latency measurements from real users
  • 21. Support for EDNS0 Client Subnet • Client-subnet extension to DNS allows a portion of the viewer's IP address to be supplied in DNS requests • Map viewer networks to optimal edge locations @cloudfront
  • 22. CloudFront Regional Edge Caches Europe Frankfurt, Germany London, EnglandNorth America N Virginia, Oregon, Ohio Asia Pacific Mumbai, India Singapore Sydney, Australia Seoul, South Korea Tokyo, Japan South America São Paulo, Brazil 11 Regional Edge Caches around the world.. @cloudfront
  • 23. CloudFront Regional Edge Caches Origin Regional Edge Cache Reducing load on CloudFront origin resources Origin Edge Locations Previous Architecture New Default Architecture @cloudfront
  • 24. #2 – Built-In Content Optimizations  Collapse multiple requests for the same object back to the origin  Serve stale content when origin is unavailable  Video optimizations for Smooth Streaming @cloudfront
  • 25. #3 – Default Network Optimizations  TCP Window Scaling & Persistent TCP Connections to reduce Round-Trip Time  Amazon Global network @cloudfront
  • 26. #4 – End-to-End Security  HTTPS delivery with SSL/TLS termination close to viewers  High security ciphers  Perfect Forward Secrecy  TCP Fast Open  Caching Session Tickets  Online Certificate Status Protocol (OCSP) Stapling @cloudfront edge location Origin User Request A
  • 27. Pop Quiz Are there performance benefits in delivering dynamic content via CloudFront?
  • 28. (C) CloudFront best practices to further prepare for large scale events @cloudfront
  • 30. Use caching up and down the stack • Database access: Amazon ElastiCache • Origin web tier: Squid/Varnish/Nginx • Edge: Amazon CloudFront • Browser @cloudfront
  • 31. Caching protects servers 2,500 RPS Network Hosts Clients Clients Cache 2,500 RPS 2,500 RPS 2,500 RPS Cache
  • 32. Caching protects network 500 Mbps Network Hosts Clients Clients Cache 500 Mbps 500 Mbps 500 Mbps Cache @cloudfront
  • 33. Browser Caching • Set max-age or expiry date in your headers (e.g. Cache-Control: max-age=3600) • HTML5 application cache • Helps eliminate network latency • But… browser cache size is limited (e.g. IE is 8-50M, Chrome is < 80M, Firefox is 50MB, etc.) @cloudfront
  • 34. CloudFront Edge Caching • Set High TTLs for intermediary caches (e.g. Cache-Control: max-age=3600, s-maxage=86400) • Don’t forward Headers, Query Strings or Cookies Note: You do need to forward the relevant headers if you’re doing CORS • In other words, use CloudFront defaults @cloudfront
  • 35. #2 Cache everything Possible (including Dynamic Content) @cloudfront
  • 36. Cache Everything Possible CloudFront supports TTLs as low as 0 seconds, no-cache, no- store, etc. Most content can be cached, even if it is for a few seconds Benefits of setting a low TTL • CloudFront supports “If-Modified-Since” and “If-None-Match” when object in the cache has expired • CloudFront will serve stale content if origin is unavailable and object is in cache • Helps you offload your origin load @cloudfront
  • 37. #3 Use multiple cache behaviors @cloudfront
  • 38. Use Multiple Cache Behaviors ONLY forward required headers • Example: don’t forward cookies for /images Avoid forwarding the User-Agent header • Instead use the Is-Mobile-Viewer, Is-Tablet-Viewer, Is-Desktop-Viewer, or Is-SmartTV-Viewer header values Avoid forwarding ALL cookies • Instead, forward only the select cookies that you use to vary your content @cloudfront
  • 40. Use HTTP/2 and Configure Keep-Alive Timeout • Enable HTTP/2 between CloudFront and Clients. HTTP/2 is a major revision of the HTTP protocol and uses several features to make page loading and rendering faster: − Multiplexing: allows multiple requests between client and CloudFront at the same time over a single connection − Header compression: Reduces overhead bytes downloaded by client, especially useful for mobile clients − Stream priority: Enables client to control order in which web assets are delivered • Keep Alive Timeout. You can now configure the maximum time that CloudFront will maintain an idle connection with a custom origin server before closing it. @cloudfront
  • 42. Using Auto Scaling effectively in web applications @cloudfront
  • 43. #6 Let your origin do only the work it needs to do @cloudfront
  • 44. Use Amazon S3 for Static Assets • Free data transfer from Amazon S3 to CloudFront • Decrease load on web server • Highly available & scalable @cloudfront
  • 45. Pop Quiz Can you run custom compute at a CloudFront location?
  • 46. Use Lambda@Edge • Lambda@Edge is an extension of AWS Lambda that allows you to run Node.js code at AWS global edge locations. • Bring your own code to the edge and customize your content very close to your users, improving the end-user experience. Continuous scaling No servers to manage Never pay for idle – no cold servers Globally distributed @cloudfront Sign up for preview: https://pages.awscloud.com/lambda-at-edge-preview.html
  • 47. CloudFront Triggers for Lambda@Edge Functions @cloudfront
  • 48. • User Properties – Identify a user’s location • Client Device properties - Delete or modify headers • A/B Testing - “Flip a coin” to select a version of content • Ad content - Rewrite URLs • Pretty URLs – Avoid revealing your origin directory structure Content Customization @cloudfront
  • 49. Visitor Validation • Handling bots • Detect search engine bots and filter traffic • Confirm valid sessions • View user-agent to confirm legitimacy of request @cloudfront
  • 51. Always Configure Custom Error Pages Custom error pages help improve customer experience Deliver error pages from Amazon S3 Set low error caching minimum TTL (e.g. 15 seconds) @cloudfront
  • 52. Poll Have you looked into securing your cloud infrastructure at the edge?
  • 54. What is AWS WAF @cloudfront https://aws.amazon.com/waf/
  • 55. HTTP floods Scanners and probes SQL injection Bots and scrapers IP reputation lists Cross-site scripting Preconfigured Protection @cloudfront
  • 56. CloudFront: How To Get Started @cloudfront
  • 57. CloudFront Getting Started CloudFront Free Tier @cloudfront Using Amazon S3? CloudFront Developer Guide: Using CloudFront with Amazon S3 Using Elastic Load Balancing? https://aws.amazon.com/cloudfront/webi nars/#slack-video
  • 58. Upcoming Amazon CloudFront Office Hours CloudFront Office Hours Thursday, April 27th, 2017 10:00 am PDT How do you register? https://aws.amazon.com/cloudfront/events/ @cloudfront