Contenu connexe Similaire à Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS re:Invent 2018 (20) Plus de Amazon Web Services (20) Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS re:Invent 20182. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Prime Video: Delivering
the Amazing Video Experience
C T D 2 0 3
Nick Benson
Software Development Manager
Amazon Prime Video
Harrison Clement
Systems Development Engineer
Amazon Prime Video
Chaitanya Solapurkar
Software Development
Engineer
Amazon CloudFront
3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What to expect from the session
• Overview of the Prime Video Business Case
• Challenges:
• Global scale
• Large catalog
• High traffic
• Resource management
• Customer satisfaction
• Tying it All Together
4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video
Our Mission: Deliver the best possible video experience to
millions of customers across hundreds of different countries.
• More than 100 million Prime Customers globally
• Available in over 200 countries
• Audio Tracks for up to 22 languages
• Thousands of different types of devices
• 10K+ End-User Networks
• Many terabits per second of data streamed to customers
• Live and On-Demand Content
• Highly variable network infrastructure
5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Video
Quality
Playback
Start time
Reliability
Time Behind
Live
Prime Video
Tradeoffs are important
6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video
Continuously defining the next rung in the ladder to improve playback
customer experience for our customers
2. Measure3. Optimize
1.Deliver
7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video traffic impacts the internet
• In the Americas, Prime Video generates 7.74%* of all downstream traffic
• In the EU, this number is 6.06%*
12:00:00 AM 12:00:00 AM 12:00:00 AM 12:00:00 AM 12:00:00 AM
Time in UTC
US Traffic Profile (UTC)
*https://www.sandvine.com/hubfs/downloads/phenomena/2018-phenomena-report.pdf
9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event forecasting planning
High Profile Events like Thursday Night Football and Prime Original releases require
accurate forecasting and careful planning
1/1/00 1/11/00 1/21/00 1/31/00
Daily VOD Streams
1/1/1900 3/21/1900 6/9/1900 8/28/1900 11/16/1900
Average Concurrent Streams per Hour
Series1 Series2
10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video: Protect Amazon resources
Reducing Calls to Origin
Asset Caching:
• Mid-Tier Caching for Live Traffic
• Large Cache Width Distribution to reduce Origin
Traffic for VOD long tail
Prime Video Service Protection:
• Cacheable Manifests Customized for Customer,
Delivery, and Device Attributes
Lambda Use Cases:
• Server Side Ad Insertion at the Edge
• Dynamic Manifest Thinning and Integration
Cached
Responses
+
Stateless
Compute
Content
Requests
Origin
Mid-
Tier
POP1 POP2
Mid-
Tier
POP3 POP4
11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront global footprint
150 Points of Presence (POP)
• 139 Edge locations
• 11 Regional Edge Caches
• In 65 cities across 29 countries
CloudFront Edge locations:
• Close to the viewers
• Connection termination
CloudFront Regional Edge Cache:
• Have larger cache width than any individual
Edge location
• Mid-tier cache between your origin server and
globally distributed Edge locations
12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudFront traffic management
Reaching a POP
• Latency-based routing (typically)
• Capacity Management
• Load Prediction
• Flashcrowd handling
• Link Aware Routing
• DDoS detection and mitigation
Edge Locations
8x Traffic
Surge during
the event
Half-time
13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudFront traffic management
Inside a POP
• Load balancing
• TLS Encryption and HTTPS
• HTTP/2
• Persistent connections
• Full and Partial object requests
• Collapsed Forwarding
• Throttling
Request
Response
Regional
Edge CacheEdge
location
14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video traffic growth on CloudFront
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
19…
15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Title popularity curve
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
0% 2% 4% 6% 8% 10% 12%
Customer Session vs Catalog Distribution
17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video: Very large catalog
• Title Options through Subscriptions, TVOD, Self-Published Platforms
• Each Title Produces Large Set of Encodes
• Many Languages
• Versions Edited for Territory Compliance
• Package Formats: MSS, DASH, HLS, MP4
• Device Capabilities: H.264, HEVC, CVBR, CBR, UHD, HDR10, DolbyHDR
• Each Bitrate Separate Encode
• Continued growth
• Problem: CDNs cannot cache all content on all edges due to limited
cache space
• Scaling Wide: Cache Optimization
• Sharding library by title popularity (optimizing popular content)
• Caching the long-tail on CloudFront
• Using the Range Header for Partial GETs
Catalog
shard2 shard3shard1 shard4
18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video demand profile on CloudFront
• In HTTP Adaptive
Streaming, media is
requested in discrete
chunks and played back
• Video players can switch
among different:
• Bitrates
• Languages
• Package Formats
• Demand curve seen at
CloudFront Edge locations
is different compared to
Title Popularity curve 0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
NetworkBytes
Disk Bytes
19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Improving cacheability on CloudFront
• TTL - long-lived v/s short-lived v/s
dynamic objects
• Reduce variants to improve cacheability
• Request Headers
• Cookies
• Query Strings
• Cache Errors – Protect Origin
• Customize Error Caching Minimum TTL
• CloudFront can deliver stale content if Origin
is unreachable
• Tune Origin timeouts
• Origin Failover
Request
Response
Regional
Edge
Cache
Edge
location
20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Self-service configuration
• Incremental level of complexity
• Manual
• Incremental level of complexity
• Manual programmatic
• Incremental level of complexity
• Manual programmatic automated
22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rapidly changing business and technology
23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video Delivery
CloudFront provides self-service rapid configuration
Using AWS tools, Prime
Video can automatically
rapidly deploy distributions
to meet business needs
Region
CloudFormation Resources
Client
24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Video: Protect customer experience
Public Internet Fault
Mitigation
• Enabling Client Failover
• CDN Switch, Origin Switch
• CDN Selection
• Measure CDN performance per
segment
• Weight CDNs according to segment
performance
Customer ISP
Peering
CDN1 CDN2
26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Quantifying customer experience
• Prime Video measures playback performance to optimize delivery
• Metrics are carefully chosen to reflect the customer streaming experience
Prime Video Analytics
27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Segment Aggregated DataSession Aggregated Input CDN Weights per Segment
CDN balancer pipeline
Temporal 1
Data Table
Temporal 2
Data Table
Temporal 3
Data Table
CDN Segment
Metrics
Compute
CDN Weight
Decision
Compute
CDN Shifted
Weights
Data Filtering
Temporal 1
Metrics Table
Temporal 2
Metrics Table
Temporal 3
Metrics Table
Load Batched
Decisions
Write Policy
CDN Weights
Policy
Prime Video
Stream
Processor
Stream
Processor
Output
28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Improving customer experience together
Prime Video
• Zero Buffer
Streams
• Concurrent
Streams
CloudFront:
Behind the Scenes
• Load balancing
improvements
• Popular objects
• Server load
• System tuning
• Disk performance
• Kernel
parameters
• Cache Policy
Week 1 Week 2 Week 3 Week 4 Week 5 Week 6
95
96
97
98
99
100
ZeroBufferRate
ConcurrentStreams
PV Re-Buffers on CF vs PV CF Traffic Allocation
29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudFront metrics and reports
• CloudWatch Metrics
• Requests
• Bytes Downloaded
• Bytes Uploaded
• Total Error Rate
• 4xx
• 5xx
• Reports
• Usage
• Requests
• Bytes
• Popular Objects
• HTTP Status Codes
30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Querying CloudFront logs using Amazon Athena
SELECT COUNT(*) AS ct, uri FROM cloudfront_logs_2
WHERE status > 500 GROUP BY uri ORDER BY ct DESC;
SELECT COUNT(*) AS ct, requestip FROM
cloudfront_logs_2 WHERE status = 404 GROUP BY
requestip ORDER BY ct DESC;
#Fields: date time x-edge-location sc-bytes c-ip cs-method cs(Host) cs-uri-stem sc-status
cs(Referer) cs(User-Agent) cs-uri-query cs(Cookie) x-edge-result-type x-edge-request-id x-
host-header cs-protocol cs-bytes time-taken x-forwarded-for ssl-protocol ssl-cipher x-
edge-response-result-type cs-protocol-version fle-status fle-encrypted-fields
2018-09-13 09:21:31 CDG54 458 212.84.57.66 GET d3i3qsqe3g3tmp.cloudfront.net
/dash/9097/5acf3fa84056f.mpd 304 http://videos.example.com/dash/9097/5acf3fa84056f.mpd
Mozilla/5.0%2520(Windows%2520NT%25206.1;%2520Win64;%2520x64)%2520AppleWebKit/537.36%2520(K
HTML,%2520like%2520Gecko)%2520Chrome/65.0.3325.181%2520Safari/537.36 - - Hit
O_7sNozG9s9NPrg3W8y_K55uXA45TBBxe-JCLPUQ_kTjfAtfpu_-Pg== videos.example.com https
329 0.024 - TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 Hit HTTP/2.0 - -
Amazon CloudFront
Access Logs
Amazon S3
31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key takeaways
• Forecasting and planning
help with traffic scaling
• Understand catalog demands
• Adapt AWS tools to your
development lifecycle
• Drive Customer Experience
improvements using
CloudFront metrics & logs
33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Related breakouts
Tuesday, Nov 27
CTD206 - Broadcasting the World's Largest Sporting Events:
AWS Media Services When It Matters Most
10:45AM – 11:45AM | MGM, Level 3, Premier Ballroom 319
Wednesday, Nov 28
CTD207 - Use Monitoring, Logs, and Analytics Tools to Measure
CDN and Site Performance
5:30PM – 6:30PM | Aria West, Level 3, Starvine 10, Table 6
Thursday, Nov 29
CTD407 - Build Workflows with Amazon CloudFront, Amazon
Route 53, & Lambda@Edge
12:15PM – 1:15PM | MGM, Level 3, North Concourse 307
34. Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nick Benson
Harrison Clement
Chaitanya Solapurkar
35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.