Rocksteady: Fast Migration for Low-Latency In-memory Storage
Chinmay Kulkarni, Aniraj Kesavan, Tian Zhang, Robert Ricci, Ryan Stutsman
1
Rocksteady: Fast Migration for Low-Latency In-memory Storage Chinmay - - PowerPoint PPT Presentation
Rocksteady: Fast Migration for Low-Latency In-memory Storage Chinmay Kulkarni , Aniraj Kesavan, Tian Zhang, Robert Ricci, Ryan Stutsman 1 Introduction Distributed low-latency in-memory key-value stores are emerging Predictable response
Rocksteady: Fast Migration for Low-Latency In-memory Storage
Chinmay Kulkarni, Aniraj Kesavan, Tian Zhang, Robert Ricci, Ryan Stutsman
1
2
multiGet( ) multiGet( )
Poor spatial locality → High multiGet() fan-out → More RPCs
3
Server 1 Server 2
No Locality Fanout=7
A C B D A B Client 1 C D Client 2
6 Million
multiGet( ) multiGet( )
4
Server 1 Server 2 A C B D A B C D C B
No Locality Fanout=7
Client 1 Client 2
6 Million
multiGet( ) multiGet( )
Better spatial locality → Fewer RPCs → Higher throughput Benefits multiGet(), range scans
5
Server 1 Server 2 A B C D A B C D
Full Locality Fanout=1 No Locality Fanout=7
Client 1 Client 2
6 Million 25 Million
6
Data Center Fabric Master Backup Master Backup Master Backup Master Backup Client Client Client Client Coordinator All Data in RAM Kernel Bypass/ DPDK 10 µs reads
7
Data Center Fabric Master Backup Master Backup Master Backup Master Backup Client Client Client Client Coordinator Write RPC
8
Data Center Fabric Master Backup Master Backup Master Backup Master Backup Client Client Client Client Coordinator 1x in DRAM 3x on Disk Write RPC
9
Data Center Fabric Master Backup Master Backup Master Backup Master Backup Client Client Client Client Coordinator
10
Data Center Fabric Master Backup Master Backup Master Backup Master Backup Client Client Client Client Coordinator 2 seconds to recover
11
Problem: Loaded source can bottleneck migration Solution: Instantly shift ownership and all load to target
12
Source Server Target Server Client 1 Client 2 Reads and Writes Client 3 Client 4
Problem: Loaded source can bottleneck migration Solution: Instantly shift ownership and all load to target
13
Source Server Target Server Client 1 Client 2 Client 3 Client 4 Instantly Redirected All future operations serviced at Target Creates “headroom” to speed migration
14
Source Server Target Server On-demand Pull Client 1 Client 2 Client 3 Client 4 Read
Problem: Data has not arrived at source yet Solution: On demand migration of unavailable data
15
Source Server Target Server Client 1 Client 2 Client 3 Client 4 Read
Problem: Data has not arrived at source yet Solution: On demand migration of unavailable data
Hot keys move early Median Latency recovers to 20 µs in 14 s
16
Source Server Target Server On-demand Pull Client 1 Client 2 Client 3 Client 4
Problem: Old single-threaded protocol limited to 130 MB/s Solution: Pipelined and parallel at source and target
Parallel Pulls
17
Source Server Target Server On-demand Pull Client 1 Client 2 Client 3 Client 4
Problem: Old single-threaded protocol limited to 130 MB/s Solution: Pipelined and parallel at source and target
Target Driven Yields to On-demand Pulls Moves 758 MB/s Parallel Pulls
18
Source Server Target Server Parallel Pulls On-demand Pull Client 1 Client 2 Client 3 Client 4 Replication
Problem: Synchronous replication bottleneck at target Solution: Safely defer replication until after migration
19
Source Server Target Server Client 1 Client 2 Client 3 Client 4 Replication
Problem: Synchronous replication bottleneck at target Solution: Safely defer replication until after migration
20
21
Source Server
22
300 Million Records 45 GB Target Server Client YCSB-B (95/5) Skew=0.99 Client YCSB-B (95/5) Skew=0.99 Client YCSB-B (95/5) Skew=0.99 Client YCSB-B (95/5) Skew=0.99
23
150 Million Records 22.5 GB Target Server Client YCSB-B (95/5) Skew=0.99 Client YCSB-B (95/5) Skew=0.99 Client YCSB-B (95/5) Skew=0.99 Client YCSB-B (95/5) Skew=0.99 150 Million Records 22.5 GB 150 Million Records 22.5 GB
Before migration: Source over-loaded, Target under-loaded Ownership transfer creates Source headroom for migration
24
80% 25% Before Ownership Transfer Immediately After Transfer Source CPU Utilization Created 55% Source CPU Headroom
25
After ownership transfer, hot keys pulled on-demand More skew → Median restored faster (migrate fewer hot keys)
26
240µs 245µs 155µs 75µs 28µs 17µs Uniform (Low) Skew=0.99 Skew=1.5 (High) 99.9th Latency Median Latency
Before Migration: Median=10 µs 99.9th = 60 µs
27
28
Target
Hash Table 8 16 24 Worker Cores
NIC
Dispatch Core
Polling
replay replay read(B) Migration Manager Pull Buffers pulling Per-Core Buffers
29
Source
NIC
Dispatch Core
Polling
read(A)
Hash Table 8 16 24
pull(11) pull(17)
Gather List Gather List Copy Addresses
30
31
Each server has a recovery log distributed across the cluster
Backup
32
Source A B C Target A A C Backup C Backup A B Backup A B Backup B C Source Recovery Log Target Recovery Log
Migrated data needs to be triplicated to target’s recovery log
33
Source A B C Target A Backup A C Backup C Backup A B Backup A B Backup B C Source Recovery Log Target Recovery Log
Migrated data needs to be triplicated to target’s recovery log
34
Source A B C Target A Backup A C Backup C Backup A B Backup A B Backup B C Source Recovery Log Target Recovery Log A A A
Synchronous replication hits migration speed by 34%
35
Source A B C Target A B Backup A C Backup C Backup A B Backup A B Backup B C Source Recovery Log Target Recovery Log B A B A B A
Replicate at Target only after all data has been moved over
36
Source A B C Target A B C Backup A C Backup C Backup A B Backup A B Backup B C Source Recovery Log Target Recovery Log
Mutations have to be replicated by the target
37
Source A B C Target A B C’ Write Backup A C Backup C Backup A B Backup A B Backup B C Source Recovery Log Target Recovery Log C’ C’ C’
recovery
migration start
38
Recover Source, recover from Target recovery log
39
Source A B C Target A B C’ Backup A C Backup C Backup A B Backup A B Backup B C Source Recovery Log Target Recovery Log C’ C’ C’
Recover from Source and Target recovery log, recover Target
40
Source A B C Target A B C’ Backup A C Backup C Backup A B Backup A B Backup B C Source Recovery Log Target Recovery Log C’ C’ C’
recovery
migration start
41
Safely Transfer Ownership At Migration Start Safely Delay Replication Till All Data Has Been Moved
42
Time Since Experiment Start (Seconds) Median Access Latency (µs)
Rocksteady Source Keeps Ownership + Sync Replication
YCSB-B, 300 Million objects (30 B key, 100 B value), migrate half
43
Time Since Experiment Start (Seconds) Median Access Latency (µs)
Rocksteady Source Keeps Ownership + Sync Replication Median latency better after ~14 seconds
YCSB-B, 300 Million objects (30 B key, 100 B value), migrate half
44
Time Since Experiment Start (Seconds) Median Access Latency (µs)
Rocksteady Source Keeps Ownership + Sync Replication Median latency better after ~14 seconds 28% faster migration
YCSB-B, 300 Million objects (30 B key, 100 B value), migrate half
(Directories)
migration
45
Source Code: https://github.com/utah-scs/RAMCloud/tree/rocksteady-sosp2017
46
47
50 100 150 200 250 300 Rocksteady
48
50 100 150 200 250 300 Rocksteady
49
50 100 150 200 250 300 Rocksteady
50