AWS Certified Advanced Networking - Specialty Exam
Total Page:16
File Type:pdf, Size:1020Kb
N E T 3 0 9 Optimizing for performance in Amazon CloudFront: Every millisecond counts! Chris O’Brien Tino Tran Karthik Uthaman Sr. Engineering Manager Principal SA Sr. Software Engineer Tinder AWS AWS © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon CloudFront 210 Points of presence (PoP) 11 Regional Edge Caches Private global network 50% Growth YoY 34 Countries and 77 Cities Optimized network Optimized servers Why does performance matter? Content acceleration with Amazon CloudFront Whole site delivery API acceleration Programmable CDN Static Content Video streaming Game/App Downloads © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Tinder? Tinder – How it works Create Profile • Bio • Location • Discovery Settings • Photos See it in action Example use case: Login • Multiple HTTPS API calls • TLS Handshake for every single call • The farther the distance, the higher the latency of the API call © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Technical architecture Client Network Backend (iOS, Android, Infrastructure Web) HTTPS communication TLS Handshake! Client Backend (iOS, Android, Infrastructure Web) TLS handshake CLIENT SERVER TLS handshake latency before Amazon CloudFront How can we reduce TLS Handshake Latency? © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon CloudFront 210 Points of presence (PoP) 11 Regional Edge Caches Private global network 50% Growth YoY 34 Countries and 77 Cities Optimized network Optimized servers Amazon CloudFront to the rescue: Really? Isn’t Amazon CloudFront just for serving static content as a CDN? How can Amazon CloudFront help reduce TLS handshake latency? • Terminate TLS handshake geographically closer to the end user at the PoP • Reuse connections from the PoP to the origin • Use optimized AWS global network to communicate from the PoP to the origin instead of communication happening over the slow internet © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Where do we start? AWS Cloud Instance AWS Elastic Load Balancing Instance Internet Instance Where do we need to end up? AWS Cloud Region Instance Internet Amazon CloudFront AWS Elastic Load Instance Balancing Instance Test case Choosing location to test: where to start? Criteria: • Enough active users to have a conclusive result • Balanced distribution of iOS, Android, and web users • Location should be as far as possible from US-EAST-1 for greatest improvement Traffic routing to Amazon CloudFront • How can we route partial traffic slowly to Amazon CloudFront? • How can we rollback if Amazon CloudFront has issues or if CloudFront increases latency? Amazon Route53 traffic policies Amazon Route 53 Amazon Route53 traffic policies Routing Policy: • Geography-based • Weight-based Amazon Route53 traffic policies Failover policy: During the Indonesia test • Verified & tested configuration in staging environments • Routed partial traffic from Indonesia to CloudFront (25%) • Noticed a few errors with headers in web client • Rolled back easily with Amazon Route53 traffic policy • Completed deployment in just 20 days TLS handshake latency results: Indonesia Without Amazon Amazon CloudFront CloudFront ~87% Reduction TLS handshake latency results: Indonesia Impact on the User Experience: • App Login became 45% faster. • Loading of profiles became 40% faster. • Image and Video uploads became 30% faster. • Other APIs saw an improvement of around 40-60% depending on payload size. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. TLS handshake latency before CloudFront TLS handshake latency with CloudFront Impact on Tinder app globally More active users than before • Users going away because of slower experienced returned to the app • Profiles loaded ~20% faster • Image uploads grew by ~15% • Total swipers increased by ~3% • Overall browsing on the app was faster Recap • Amazon CloudFront optimizes dynamic workloads • Implementing Amazon CloudFront is simple and fast • Tinder’s API performance improved by 30 - 45% © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon CloudFront Global Network Why leverage AWS backbone network? Performance All commercial Region-to-Region traffic traverses the backbone except China How does AWS connect to the internet? AWS Regional Points of Presence (PoP) Transit Centers PoP network connectivity Extends the AWS global network Increased network scaling Optimal interconnection PeeringDB: • 100+ Facilities • 170 Internet exchanges Internet Private Exchange Peering © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Intelligent routing d1886tp5fhflpy.cloudfront.net? Amazon CloudFront DNS Performance POP Health Server Capacity Network Capacity TCP congestion control TCP BBR – Bottleneck Bandwidth and Round trip time • Responds to actual congestion, not packet loss • Measures RTT and bandwidth • Probes for changes in bandwidth • Saturates the bottleneck limit TCP BBR - Results Read our blog post: https://tinyurl.com/CF-BBR-RESULT TLS - Encryption in transit “There’s so much security built into cloud computing platforms today, for us, it’s our No. 1 priority—it’s not even close, relative to anything else.” - Andy Jassy TLS performance Server Server 1 RTT 2 RTT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Server-side optimizations • Optimizing dynamic content delivery • Optimizing for media • Reducing origin load Amazon CloudFront DNS Caching is hard Layers and layers of cache POP Server-1 Server-n L1 Cache L1 Cache L2 Cache L2 Cache L3 L3 Dynamic content acceleration Cache Server • TLS Termination at the edge, improves overall latency • Skip the cache layers L1 • Use persistent connections to origins L1 Cache L2 Cache L3 Persistent connections to origins • Reusing connections improve latency • Persistent connections provide better throughput Max. Receiver Capacity Congestion Avoidance Slow start Tinder without Amazon CloudFront > 500 ms When Tinder met Amazon CloudFront Optimizing media workload • CloudFront delivered some of the largest media events in 2019 Media delivery - Challenge Flash crowd – Fan ’em out Object RPS/BPSx grumpycat.mpeg 1000 mbps Layer-1 Cache Layer-1 Cache Layer-1 Cache Server Load Server-1 0.55 Server-1 0.95 Server-2 0.57 Layer-2 Cache Layer-2 Cache Layer-2 Cache Server-2 0.57 Server-3 0.46 Server-3 0.46 L3 L3 L3 Flash crowd – Collapse ’em Layer-1 Cache Layer-1 Cache Layer-1 Cache Layer-2 Cache Layer-2 Cache Layer-2 Cache L3 L3 L3 Flash crowd – Cache ‘em everywhere Object RPS/BPSx grumpycat.mpeg 1000 mbps Layer-1 Cache Layer-1 Cache Layer-1 Cache Layer-2 Cache Layer-2 Cache Layer-2 Cache L3 L3 L3 Reducing origin load • 210 POPs • Customer’s origin started seeing more load Reducing Miss latency – P90 Reducing origin traffic Recap • Amazon CloudFront is a global network, growing 50% YoY • Amazon CloudFront is easy to deploy and manage • AWS managed backbone network provides reliable performance • Amazon CloudFront is always optimizing the infrastructure and service Every Millisecond Counts Related breakouts NET310 - Building serverless micro frontends at the edge NET313 - Maintaining security and availability on the unpredictable internet Learn networking with AWS Training and Certification Resources created by the experts at AWS to help you build and validate networking skills Free digital courses cover topics related to networking and content delivery, including Introduction to Amazon CloudFront and Introduction to Amazon VPC Validate expertise with the AWS Certified Advanced Networking - Specialty exam Visit aws.amazon.com/training/paths-specialty © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! Chris O’Brien Tino Tran Karthik Uthaman [email protected] [email protected] [email protected] © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. TINDER®, SWIPE®, SUPER LIKE™, REWIND™, the IT’S A MATCH!™ screen, and the Flame Logo are the exclusive trademarks of Match Group, LLC. Presentation © 2019 Match Group, LLC © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved..