millisort: an experiment in flash bursts li.pdfwith seo jin park, collin lee, john ousterhout. ......

37
MilliSort: an Experiment in Flash Bursts Yilong Li with Seo Jin Park, Collin Lee, John Ousterhout

Upload: others

Post on 06-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

MilliSort: an Experiment in Flash BurstsYilong Li

with Seo Jin Park, Collin Lee, John Ousterhout

Page 2: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Introduction: Flash Burst

Slide 2

● Today’s large-scale datacenter applications run from seconds to hours

● Flash burst: a new style of datacenter computation○ Very short lifetime (e.g., < 10 ms)○ Harness hundreds or thousands of servers○ Enable data-intensive real-time analytics

● Understand requirements of a general-purpose infrastructure for executing and managing flash burst application○ Create an example application (i.e., MilliSort) to learn about flash burst

● Lessons learned:○ Possible to organize 1000s of servers to perform non-trivial computation in <10 ms○ Group communication operations are critical to performance○ Full bisection bandwidth is necessary for best performance of shuffle

Page 3: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Introduction: MilliSort

Slide 3

● MilliSort: sort as many small records as possible within 1 ms, using any number of servers available in a datacenter

● Why sorting?○ Intensive and unpredictable communication○ Interesting algorithm○ Useful building block in distributed computation

● Early results○ Sort 4.6 million 100-byte records using 700 servers (106x speedup) in 1 ms○ # servers harnessed & data per server increase linearly with time budget○ # records sortable increases quadratically with time budget

Page 4: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Outline

Slide 4

● Millisort Overview

● Implementation & Cost Estimator

● Measurements

Page 5: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● How many small records can you sort in 1 ms using unlimited number of servers available in a datacenter?○ 100-byte records (10-byte keys and 90-byte values)○ Input data already distributed evenly among servers in DRAM○ Result data not required to be distributed evenly across servers

The MilliSort Challenge

Slide 5

Server 1 Server 2 Server 3 Server 999 Server 1000...

Server 1 Server 2 Server 3 Server 999 Server 1000≤ ≤ ≤...

MilliSort

Page 6: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Most distributed sorting algorithms are a form of bucket sort○ Local sort: each server sorts its initial data○ Partitioning bucket boundaries:

determine the key range each server stores after sorting

○ Shuffle data: each server transmits its records to the targets

● Advantages:○ Optimize network bandwidth usage○ Simple to implement

Background: Distributed Bucket Sort

Slide 6

B3 A4 B1 A2 B4A1 B2 A3

B3A4 B1A2 B4A3 B2A1

B2B1 B4B3A2A1 A4A3

Server 1 Server 2

KeyRange: A0-A9 KeyRange: B0-B9

Page 7: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Terminology:● Pivot: key chosen to divide local

records● Splitter: pivot chosen to be final

bucket boundary

Parameters:● M: number of machines● P: number of pivots per server

If P = M, the skew factor of the final data bucket is at most 2.

MilliSort: A Strawman Partition Scheme

Slide 7

Coordinator

Page 8: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Terminology:● Pivot: key chosen to divide local

records● Splitter: pivot chosen to be final

bucket boundary

Parameters:● M: number of machines● P: number of pivots per server

If P = M, the skew factor of the final data bucket is at most 2.

MilliSort: A Strawman Partition Scheme

Slide 8

CoordinatorOne node can’t sort M2 pivots fast enough!

Page 9: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Key idea: sorting pivots is just a smaller version of MilliSort○ Apply distributed bucket sort again○ Use a smaller set of servers

● Recursive reduction:○ Assign one pivot sorter every R

servers (# pivot sorters = M/R)○ L2 pivot: chosen to divide L1

pivots on pivot servers○ L2 splitter: L2 pivot chosen to be

L1 pivot bucket boundary

Recursive Partitioning

Slide 9

Pivot Sorting

Page 10: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Key idea: sorting pivots is just a smaller version of MilliSort○ Apply distributed bucket sort again○ Use a smaller set of servers

● Recursive reduction:○ Assign one pivot sorter every R

servers (# pivot sorters = M/R)○ L2 pivot: chosen to divide L1

pivots on pivot servers○ L2 splitter: L2 pivot chosen to be

L1 pivot bucket boundary

Recursive Partitioning

Slide 10

Page 11: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Key idea: sorting pivots is just a smaller version of MilliSort○ Apply distributed bucket sort again○ Use a smaller set of servers

● Recursive reduction:○ Assign one pivot sorter every R

servers (# pivot sorters = M/R)○ L2 pivot: chosen to divide L1

pivots on pivot servers○ L2 splitter: L2 pivot chosen to be

L1 pivot bucket boundary

Recursive Partitioning

Slide 11

Page 12: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Key idea: sorting pivots is just a smaller version of MilliSort○ Apply distributed bucket sort again○ Use a smaller set of servers

● Recursive reduction:○ Assign one pivot sorter every R

servers (# pivot sorters = M/R)○ L2 pivot: chosen to divide L1

pivots on pivot servers○ L2 splitter: L2 pivot chosen to be

L1 pivot bucket boundary

Recursive Partitioning

Slide 12

Page 13: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Key idea: sorting pivots is just a smaller version of MilliSort○ Apply distributed bucket sort again○ Use a smaller set of servers

● Recursive reduction:○ Assign one pivot sorter every R

servers (# pivot sorters = M/R)○ L2 pivot: chosen to divide L1

pivots on pivot servers○ L2 splitter: L2 pivot chosen to be

L1 pivot bucket boundary

Recursive Partitioning

Slide 13

Page 14: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● As data is divided over more servers:○ Each node must send more messages○ Each message gets smaller○ Fixed per-message SW overhead limits performance eventually

● Reduce # messages to send per server with 2-level shuffle○ Divide servers into √M groups (√M servers each)○ Shuffle within groups & shuffle between groups○ Each server sends fewer messages○ Double network bandwidth usage

Large-Scale Shuffle: Per-Message Cost Matters

Slide 14

S0 S1 S2 S3

S0 S1 S2 S3

S0 S1 S2 S3

Data0↦1Data0↦3

Data0↦3Data1↦3

Page 15: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Outline

Slide 15

● Millisort Overview

● Implementation & Cost Estimator

● Measurements

Page 16: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Prototype implementation using network transport infrastructure from RAMCloud○ Kernel bypass with DPDK or Infiniband Verbs: 5 µs RTT, 25 Gbps throughput○ Arachne for user-level thread and core management○ ~1500 lines of C++ code for group communication operations○ ~3000 lines of C++ code for Millisort application

● Limitations due to RAMCloud’s dispatch model○ Require all outgoing/incoming messages to pass through a single dispatch thread○ Single dispatch thread w/o batch send: ~1.6 million messages/second

Implementation

Slide 16

Page 17: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Goal: quickly explore a wide range of configurations○ Try larger system scales than are possible with the implementation○ Find optimal configuration from the configuration space (e.g., # servers, # pivot

sorters, # levels of partitioning, etc.)○ Vary basic technology parameters (e.g., network speed, latency, software

overhead, etc.)

● Cost estimator implementation○ ~900 lines of Python code○ Simulate MilliSort algorithm at a high level (i.e., a series of group comm. ops)○ Estimate broadcast, gather, and all-gather cost using a message cost model○ Shuffle cost is modeled differently, as a function of the shuffle message size

Cost Estimator Overview

Slide 17

Page 18: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Message cost modeled as a function of message size○ MsgDelay(msgSize): one-way delay (incl. SW overhead)○ {Send, Recv}Cost(msgSize): marginal cost to send/receive a message

● Works well for broadcast, gather, and all-gather operations

Model Calibration: Message Cost Model

Slide 18

MsgDelay(msgSize)

SendCost(msgSize)

Page 19: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Total sort time, implementation vs. cost estimator

Model Calibration: End-to-End

Slide 19

Cost estimator predicts total sort time quite accurately at small scale.

Page 20: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Outline

Slide 20

● Millisort Overview

● Implementation & Cost Estimator

● Measurements

Page 21: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Cost estimator parameters○ 4 cores / node, 2 threads / core○ 40 Gbps full bisection network

● Within 1 ms, MilliSort can sort 4.6 million records using 700 servers○ ~600 ns CPU time (phys. core) to sort one record

How many records can you sort in 1 ms?

Slide 21

Page 22: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Cost estimator parameters○ 4 cores / node, 2 threads / core○ 40 Gbps full bisection network

● Within 1 ms, MilliSort can sort 4.6 million records using 700 servers○ ~600 ns CPU time (phys. core) to sort one record

● Within 10 ms, MilliSort can sort 1 billion records using 13600 servers

How many records can you sort in 1 ms?

Slide 22

1 ms 10 ms 𝚫

Total records 4.6 million 1 billion 225X

# records/server 6600 76000 11.5X

# servers 700 13600 19.4X

Page 23: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

● Cost estimator parameters○ 4 cores / node, 2 threads / core○ 40 Gbps full bisection network

● Within 1 ms, MilliSort can sort 4.6 million records using 700 servers○ ~600 ns CPU time (phys. core) to sort one record

● Within 10 ms, MilliSort can sort 1 billion records using 13600 servers

How many records can you sort in 1 ms?

Slide 23

1 ms 10 ms 𝚫

Total records 4.6 million 1 billion 225X

# records/server 6600 76000 11.5X

# servers 700 13600 19.4X

>100X since shuffle becomes more efficient

Page 24: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Impact of Time Budget on MilliSort

Slide 24

Page 25: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

MilliSort can coordinate 1000s of machines for sorting in a few milliseconds

Impact of Time Budget on MilliSort

Slide 25

Page 26: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

MilliSort can coordinate 1000s of machines for sorting in a few milliseconds

Impact of Time Budget on MilliSort

Slide 26

Increase quadraticallyIncrease linearly

Page 27: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Time to Sort 4.6 Million Records, Vary # Servers

Slide 27

Page 28: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Time to Sort 4.6 Million Records, Vary # Servers

Slide 28

1L shuffle quickly becomes very inefficient

Page 29: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Time to Sort 4.6 Million Records, Vary # Servers

Slide 29

Page 30: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Time to Sort 4.6 Million Records, Vary # Servers

Slide 30

Total time bottoms out as partitioning cost becomes more significant

Page 31: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Time to Sort 4.6 Million Records, Vary # Servers

Slide 31

Shuffle accounts for >50% total time

Page 32: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Multi-level Partitioning

Slide 32

Page 33: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Multi-level Partitioning

Slide 33

1-level partitioning is not scalable

Page 34: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Multi-level Partitioning

Slide 34

Partitioning cost increases linearly with # servers

Page 35: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Multi-level Partitioning

Slide 35

Structuring communication hierarchically is a useful technique to handle large cluster sizes.

Page 36: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Conclusion

Slide 36

● We developed MilliSort as an experiment to explore the notion of flash burst computation

● Flash burst○ Possible to harness 1000s of servers working together for a few milliseconds○ Communication must be structured hierarchically to handle large cluster sizes○ Full bisection bandwidth is necessary for best performance

● Low-latency distributed sorting○ # records sortable grows quadratically with the time budget○ Efficient group communication is essential, especially shuffle○ Easier to scale # machines than per-server data

Page 37: MilliSort: an Experiment in Flash Bursts Li.pdfwith Seo Jin Park, Collin Lee, John Ousterhout. ... 100-byte records (10-byte keys and 90-byte values) Input data already distributed

Slide 37

Questions?