Saturday, October 10, 2015

Achieving Rapid Response Times in Large Online Services



Achieving Rapid Response Times in Large Online Services
Video: https://www.youtube.com/watch?v=1-3Ahy7Fxsc
Large Fanout Services
Why Does Fanout Make Things Harder?

Overall latency ≥ latency of slowest component
–small blips on individual machines cause delays
–touching more machines increases likelihood of delays
• Server with 1 ms avg. but 1 sec 99%ile latency
–touch 1 of these: 1% of requests take ≥1 sec
–touch 100 of these: 63% of requests take ≥1 sec

One Approach: Squash All Variability
Careful engineering all components of system
• Possible at small scale
–dedicated resources
–complete control over whole system
–careful understanding of all background activities
–less likely to have hardware fail in bizarre ways
System changes are difficult
–software or hardware changes affect delicate balance
One Approach: Squash All Variability
Not tenable at large scale: need to share resources

Shared Environment
Huge benefit: greatly increased utilization
• ... but hard to predict effects increase variability
–network congestion
–background activities
–bursts of foreground activity
–not just your jobs, but everyone else’s jobs, too
• Exacerbated by large fanout systems

Basic Latency Reduction Techniques
Differentiated service classes
–prioritized request queues in servers
–prioritized network traffic
• Reduce head-of-line blocking
–break large requests into sequence of small requests

Manage expensive background activities
–e.g. log compaction in distributed storage systems
–rate limit activity
–defer expensive activity until load is lower

Synchronized Disruption
Large systems often have background daemons
–various monitoring and system maintenance tasks
• Initial intuition: randomize when each machine
performs these tasks
–actually a very bad idea for high fanout services
• at any given moment, at least one or a few machines are slow
• Better to actually synchronize the disruptions
–run every five minutes “on the dot”
–one synchronized blip better than unsynchronized

Tolerating faults:
– rely on extra resources
• RAIDed disks, ECC memory, dist. system components, etc.
– make a reliable whole out of unreliable parts
• Tolerating variability:
– use these same extra resources
– make a predictable whole out of unpredictable parts
Times scales are very different:
– variability: 1000s of disruptions/sec, scale of milliseconds
– faults: 10s of failures per day, scale of tens of seconds

Latency Tolerating Techniques
Cross request adaptation
–examine recent behavior
–take action to improve latency of future requests
–typically relate to balancing load across set of servers
–time scale: 10s of seconds to minutes
• Within request adaptation
–cope with slow subsystems in context of higher level
request
–time scale: right now, while user is waiting

Load Balancing
Can shed load in few percent increments
–prioritize shifting load when imbalance is more severe

Backup Requests w/ Cross-Server Cancellation

Labels

Review (572) System Design (334) System Design - Review (198) Java (189) Coding (75) Interview-System Design (65) Interview (63) Book Notes (59) Coding - Review (59) to-do (45) Linux (43) Knowledge (39) Interview-Java (35) Knowledge - Review (32) Database (31) Design Patterns (31) Big Data (29) Product Architecture (28) MultiThread (27) Soft Skills (27) Concurrency (26) Cracking Code Interview (26) Miscs (25) Distributed (24) OOD Design (24) Google (23) Career (22) Interview - Review (21) Java - Code (21) Operating System (21) Interview Q&A (20) System Design - Practice (20) Tips (19) Algorithm (17) Company - Facebook (17) Security (17) How to Ace Interview (16) Brain Teaser (14) Linux - Shell (14) Redis (14) Testing (14) Tools (14) Code Quality (13) Search (13) Spark (13) Spring (13) Company - LinkedIn (12) How to (12) Interview-Database (12) Interview-Operating System (12) Solr (12) Architecture Principles (11) Resource (10) Amazon (9) Cache (9) Git (9) Interview - MultiThread (9) Scalability (9) Trouble Shooting (9) Web Dev (9) Architecture Model (8) Better Programmer (8) Cassandra (8) Company - Uber (8) Java67 (8) Math (8) OO Design principles (8) SOLID (8) Design (7) Interview Corner (7) JVM (7) Java Basics (7) Kafka (7) Mac (7) Machine Learning (7) NoSQL (7) C++ (6) Chrome (6) File System (6) Highscalability (6) How to Better (6) Network (6) Restful (6) CareerCup (5) Code Review (5) Hash (5) How to Interview (5) JDK Source Code (5) JavaScript (5) Leetcode (5) Must Known (5) Python (5)

Popular Posts