Tail Tolerance
Variability
Variability of response time leads to high tail latency
- Parallelization is often used to reduce latency, but also amplifies variability
Scenario: A request is broken into sub-operations that are issued to multiple servers in parallel
- These sub-operations must all complete (Let Pr(latency > 1s) = 0.01)
- Sub-operations of a request issued to 100 servers Pr(request > 1s) = 1 – (1 – 0.01)100 = 0.63
Reducing Variability
Reducing head-of-line blocking
- HOL blocking: blocked by large requests at the front of a queue
- Solution: break a long-running request into smaller slices and allow them interleave with others
Background Activities
- Managing background activities and synchronized disruption
- Synchronizing all background activities reduces variability
Tail-Tolerant Techniques
Within Request Short-Term Adaptations
Hedged Requests (Reactive)
Assume: data items replicated in different servers, so we can try to process this request in different copies- Send a request to the primary server
- Send the same request (i.e., hedged request) to a different server after some brief delay
- Cancel any outstanding request if the response isreceived
- Drawback: still need to wait for the "brief" delay
Tied Requests (Proactive)
- Send the multiple requests in parallel to multiple servers simultaneously (take action immediately)
- Allow servers to communicate updates on the status of these copies to each other (e.g., send a message when the request is processed to call them can stop processing)
- Drawback: 1. Redundant requests are sending out 2. It requires servers to communicate with each others, but sometimes servers may not have this capability, which is not easy to generalize
Cross-Request Long-Term Adaptations
Micro-partitions
- Generate many more partitions than servers
- Perform load balancing at the (more fine-grained) partition level
- Example: tablets in BigTable: we divided the tables into tablets, which is for load balancing (move some tablets to other servers)
Selective replication
- Idea: look at some items / micro-partition that are likely to cause load balance, and we create more replicas for them
- Caused by the workload characteristic, some items maybe popular to the others (“hot” items) may get lots of requests, so we make replications and store them across the servers
Latency-inducted probation
- If a server is detected to respond slowly, don’t add more requests to this server (put it on probation)
- Issue shadow requests (broke the server) to the slow servers and collect statistics from them; bring the servers back to normal if they are ready
Special Cases
Take “good enough” responses
- Sometimes we don’t need to wait the responses from all the servers, the user accepts the slightly incomplete results for better end-to-end latency (even if we ignore / miss some responses, we are still acceptable)
- Example: PageRank: even if we ignore some results, it does not significantly affect the results / user experiences for the recommendation
Canary requests
- If we want to send the requests to thousands of servers, we can test one or two servers first to test the stability of the servers. If those servers return the results very late, it may imply that the system is overload or the network is congested
- The remaining servers are only queried if there is a successful response from the canary in a reasonable period of time
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.


