jason teoh, muhammad ali gulzar, harry xu, miryungkim ... · computation skew 9 term hello world...

61
PerfDebug: Performance Debugging of Computation Skew in Dataflow Systems Jason Teoh, Muhammad Ali Gulzar, Harry Xu, Miryung Kim University of California, Los Angeles

Upload: others

Post on 15-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

PerfDebug: Performance Debugging of Computation Skew in Dataflow Systems

Jason Teoh, Muhammad Ali Gulzar, Harry Xu, Miryung KimUniversity of California, Los Angeles

Page 2: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

2

20GB

Web ServerAnomaly Detection

Cron Day 1

Motivating ExampleServer Logs

Page 3: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

3

20GB

Web ServerAnomaly Detection

Cron Day 1

Execution Time : 28 s

Motivating ExampleServer Logs

Page 4: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

4

20GB

20GB

Web ServerAnomaly Detection

Cron Day 1

Cron Day 2

Execution Time : 25 s

Execution Time : 28 s

Motivating ExampleServer Logs

Page 5: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

5

20GB

20GB

20GBWeb Server

Anomaly Detection

Server LogsCron Day 1

Cron Day 2

Cron Day 3

Execution Time : 92 s

Execution Time : 25 s

Execution Time : 28 s

Motivating Example

Page 6: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

6

20GB

20GB

20GBWeb Server

Anomaly Detection

Server LogsCron Day 1

Cron Day 2

Cron Day 3

Execution Time : 92 s

Execution Time : 25 s

Execution Time : 28 s

Motivating Example

Page 7: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

7

20GB

20GB

20GBWeb Server

Anomaly Detection

Server LogsCron Day 1

Cron Day 2

Cron Day 3

Execution Time : 92 s

Execution Time : 25 s

Execution Time : 28 s

Motivating Example

Why does my job run slowly for day 3’s data?

Page 8: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Data Skew in Distributed Processing

8

Worker1

Worker2

Worker3

Uneven distribution of data across partitions, tasks, or workers can lead to performance delays.

Page 9: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Computation Skew

9

Term

Hello World

Big Data

Debugging

PerfDebug

Term Latency

Hello World 2 ms

Big Data 1 ms

Debugging 3 ms

PerfDebug 442 ms

commonDefs = {“Hello World”: ..,,“Big Data”: ..,,“Debugging”: ...,...

}

if (commonDefs.contains(term)) {return commonDefs.get(term)

} else {r = new RedisClient(…)return r.get(term)

}

User-defined function

Uneven distribution of computation due to interactions between data and application code.

Page 10: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Computation Skew

Why is it challenging?• Requires insight on how application code interacts with data.• Occurs across multiple stages.• Affected applications are inherently expensive to run.• Isolating individual records that impact performance is difficult with

existing tools.

10

Page 11: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Output:Individual records responsible for computation skew

Performance Debugging of Computation Skew

14

PerfDebug

Computation Skew Detection

Data Provenance + Record-Level

Latency

Expensive Record Identification

Input: Spark program, input data

Page 12: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Output:Individual records responsible for computation skew

PerfDebug Approach

15

PerfDebug

Computation Skew Detection

Data Provenance + Record-Level

Latency

Expensive Record Identification

Input: Spark program, input data

Page 13: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Computation Skew Detection• PerfDebug monitors task-level metrics such as latency, garbage

collection, and serialization using SparkListener API.• If potential computation skew is found, rerun the user program in

debugging mode to collect additional information.

17

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 14: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Output:Individual records responsible for computation skew

PerfDebug Approach

18

PerfDebug

Computation Skew Detection

Data Provenance + Record-Level

Latency

Expensive Record Identification

Input: Spark program, input data

Page 15: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Capture Data Provenance

Titian [VLDB 2016] provides data provenance using provenance tables at the start/end of stages to track input-output record mappings. 19

Stage 1

lines mapreduceByKey(map-side)

Stage 2

reduceByKey(reduce-side)

map

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 16: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Capture Data Provenance

Titian [VLDB 2016] provides data provenance using provenance tables at the start/end of stages to track input-output record mappings. 20

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

Stage 2

reduceByKey(reduce-side)

map

Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 17: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Capture Data Provenance

Titian [VLDB 2016] provides data provenance using provenance tables at the start/end of stages to track input-output record mappings. 21

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

Stage 2

reduceByKey(reduce-side)

map

Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 18: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Capture Data Provenance

Titian [VLDB 2016] provides data provenance using provenance tables at the start/end of stages to track input-output record mappings. 22

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

Stage 2

reduceByKey(reduce-side)

map

Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 19: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Capture Data Provenance

Titian [VLDB 2016] provides data provenance using provenance tables at the start/end of stages to track input-output record mappings. 23

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

{id1, id3}(0, 100)

{id2} (0, 200)

… …

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

Stage 2

reduceByKey(reduce-side)

map

Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 20: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Capture Data Provenance

Titian [VLDB 2016] provides data provenance using provenance tables at the start/end of stages to track input-output record mappings. 24

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

{id1, id3}(0, 100)

{id2} (0, 200)

… …

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

Stage 2

reduceByKey(reduce-side)

map

Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 21: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Measure UDF Latency

PerfDebug extends Titian by capturing summed UDF execution times.25

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

Stage 2

reduceByKey(reduce-side)

map

Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 22: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage 2

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Measure UDF Latency

PerfDebug extends Titian by capturing summed UDF execution times.26

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

7 ms 3 ms

Input ID Output ID

100 output1

200 output2

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 23: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage 2

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 7 + 3 = 10 ms

{id2} (0, 200)

… …

Measure UDF Latency

PerfDebug extends Titian by capturing summed UDF execution times.27

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

7 ms 3 ms

Input ID Output ID

100 output1

200 output2

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 24: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage 2 Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID UDF Latency

100 output1 30 ms

200 output2 40 ms

… … …

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 10 ms

{id2} (0, 200) 20 ms

… … …

Measure UDF Latency

PerfDebug extends Titian by capturing summed UDF execution times.28

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 25: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage 2 Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID UDF Latency

100 output1 30 ms

200 output2 40 ms

… … …

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 10 ms

{id2} (0, 200) 20 ms

… … …

Measure Shuffle Latency

PerfDebug captures data movement costs through partition-level shuffle latencies. 29

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 26: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage 2 Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID UDF Latency

100 output1 30 ms

200 output2 40 ms

… … …

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 10 ms

{id2} (0, 200) 20 ms

… … …

Measure Shuffle Latency

PerfDebug captures data movement costs through partition-level shuffle latencies. 30

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Partition Shuffle Latency

1 80 ms

2 50 ms

3 100 ms

… …

Stag

e 2

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 27: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage 2 Input ID Output ID

100 output1

200 output2

… …

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Input ID Output ID UDF Latency

100 output1 30 ms

200 output2 40 ms

… … …

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 10 ms

{id2} (0, 200) 20 ms

… … …

Calculate Stage Latency

PerfDebug calculates per-record stage latency by adding UDF latency and shuffle latency proportional to input count. 31

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Partition Shuffle Latency

1 80 ms

2 50 ms

3 100 ms

… …

Stag

e 2

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 28: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stg Latency

10 + 0 ms

20 + 0 ms

Input ID Output ID UDF Latency

100 output1 30 ms

200 output2 40 ms

… … …

Stage 2

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Calculate Stage Latency

PerfDebug calculates per-record stage latency by adding UDF latency and shuffle latency proportional to input count. 32

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Partition Shuffle Latency

1 80 ms

2 50 ms

3 100 ms

… …

Stag

e 2

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 10 ms

{id2} (0, 200) 20 ms

… … …

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 29: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stg Latency

10 ms

20 ms

Input ID Output ID UDF Latency

100 output1 30 ms

200 output2 40 ms

… … …

Stage 2

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Calculate Stage Latency

PerfDebug calculates per-record stage latency by adding UDF latency and shuffle latency proportional to input count. 33

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Partition Shuffle Latency

1 80 ms

2 50 ms

3 100 ms

… …

Stag

e 2

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 10 ms

{id2} (0, 200) 20 ms

… … …

Stg Latency

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 30: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stg Latency

10 ms

20 ms

Input ID Output ID UDF Latency

100 output1 30 ms

200 output2 40 ms

… … …

Stage 2

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Calculate Stage Latency

PerfDebug calculates per-record stage latency by adding UDF latency and shuffle latency proportional to input count. 34

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Partition Shuffle Latency

1 80 ms

2 50 ms

3 100 ms

… …

Stag

e 2

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 10 ms

{id2} (0, 200) 20 ms

… … …

Stg Latency

30 + 𝟐𝟏𝟔

* 80

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 31: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stg Latency

10 ms

20 ms

Input ID Output ID UDF Latency

100 output1 30 ms

200 output2 40 ms

… … …

Stage 2

Input ID Output ID

{id1, id3} (0, 100)

{id2} (0, 200)

… …

Calculate Stage Latency

PerfDebug calculates per-record stage latency by adding UDF latency and shuffle latency proportional to input count. 35

Stage 1

lines mapreduceByKey(map-side)

Input ID Output ID

(0, 100) 100

(1, 100) 100

(0, 200) 200

… …

reduceByKey(reduce-side)

map

Input ID Output ID

offset1 id1

offset2 id2

offset3 id3

… …

Partition Shuffle Latency

1 80 ms

2 50 ms

3 100 ms

… …

Stag

e 2

Input ID Output ID UDF Latency

{id1, id3} (0, 100) 10 ms

{id2} (0, 200) 20 ms

… … …

Stg Latency

40 ms

45 ms

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 32: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Output:Individual records responsible for computation skew

PerfDebug Approach

36

PerfDebug

Computation Skew Detection

Data Provenance + Record-Level

Latency

Expensive Record Identification

Input: Spark program, input data

Page 33: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Expensive Record Identification

• Stage Latency is within a given stage and insufficient for debugging. • Code and data interact across multiple stages.

37

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 34: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

• Stage Latency is within a given stage and insufficient for debugging. • Code and data interact across multiple stages.

Stage 1

Expensive Record Identification

38

InputID Output ID Stg Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage 2InputID Output ID Stg Latency

o1 output1 65 ms

o2 output2 70 ms

o3 output3 40 ms

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 35: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

• Stage Latency is within a given stage and insufficient for debugging. • Code and data interact across multiple stages.

Stage 1

Expensive Record Identification

39

InputID Output ID Stg Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage 2InputID Output ID Stg Latency

o1 output1 65 ms

o2 output2 70 ms

o3 output3 40 ms?

? What about the slowest records in each stage?

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 36: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

• Stage Latency is within a given stage and insufficient for debugging. • Code and data interact across multiple stages.

Stage 1

Expensive Record Identification

40

InputID Output ID Stg Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage 2InputID Output ID Stg Latency

o1 output1 65 ms

o2 output2 70 ms

o3 output3 40 ms?

? Computation skew can span multiple stages!

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 37: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage K

Propagate End-to-End Latency

41

InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage K+1InputID Output ID Stg Latency

o1 output1 65 ms

o2 output2 70 ms

o3 output3 40 ms

PerfDebug propagates end-to-end latency by adding stage latency to the slowest (max) end-to-end latency of the previous stage.

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 38: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage K

Propagate End-to-End Latency

42

InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage K+1InputID Output ID Stg Latency

o1 output1 65 ms

o2 output2 70 ms

o3 output3 40 ms

PerfDebug propagates end-to-end latency by adding stage latency to the slowest (max) end-to-end latency of the previous stage.

E2E Latency

65 + max(40,55)

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 39: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage K

Propagate End-to-End Latency

43

InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage K+1InputID Output ID Stg Latency

o1 output1 65 ms

o2 output2 70 ms

o3 output3 40 ms

PerfDebug propagates end-to-end latency by adding stage latency to the slowest (max) end-to-end latency of the previous stage.

E2E Latency

65 + max(40,55)

70 + max(30,25)

40 + max(40,60)

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 40: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage K

Propagate End-to-End Latency

44

InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage K+1InputID Output ID E2E Latency

o1 output1 120 ms

o2 output2 100 ms

o3 output3 100 ms

PerfDebug propagates end-to-end latency by adding stage latency to the slowest (max) end-to-end latency of the previous stage.

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 41: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage K

Propagate End-to-End Latency

45

InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage K+1InputID Output ID E2E Latency

o1 output1 120 ms

o2 output2 100 ms

o3 output3 100 ms

PerfDebug propagates end-to-end latency by adding stage latency to the slowest (max) end-to-end latency of the previous stage.

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 42: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Propagate Expensive Inputs

• Not all inputs contribute equally to application performance.• Data provenance alone cannot differentiate between these inputs if

multiple map to the same record.

46

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 43: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Propagate Expensive Inputs

47

Stage 1InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage 2InputID Output ID E2E Latency

o1 output1 120 ms

o2 output2 100 ms

o3 output3 100 ms

For each record within each stage, PerfDebug extends end-to-end latency by tracking the program input for the path of max latency.

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 44: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Propagate Expensive Inputs

48

Stage 1InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage 2InputID Output ID E2E Latency

o1 output1 120 ms

o2 output2 100 ms

o3 output3 100 ms

For each record within each stage, PerfDebug extends end-to-end latency by tracking the program input for the path of max latency.

Exp. Input

input1

input2

input3

input4

input5

input6

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 45: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Propagate Expensive Inputs

49

Stage 1InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

Stage 2InputID Output ID E2E Latency

o1 output1 120 ms

o2 output2 100 ms

o3 output3 100 ms

For each record within each stage, PerfDebug extends end-to-end latency by tracking the program input for the path of max latency.

Exp. Input

input1

input2

input3

input4

input5

input6

Exp. Input

input5

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 46: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Stage 2

Propagate Expensive Inputs

50

Stage 1InputID Output ID E2E Latency

input1 o1 40 ms

input2 o2 30 ms

input3 o2 25 ms

input4 o3 40 ms

input5 o1 55 ms

input6 o3 60 ms

InputID Output ID E2E Latency

o1 output1 120 ms

o2 output2 100 ms

o3 output3 100 ms

For each record within each stage, PerfDebug extends end-to-end latency by tracking the program input for the path of max latency.

Exp. Input

input1

input2

input3

input4

input5

input6

Exp. Input

input5

input2

input6

Computation Skew

Detection

Data Provenance + Record-Level

Latency

Expensive Record

Identification

Page 47: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

PerfDebug Approach Recap

• Monitoring to detect presence of computation skew• Instrumented execution to collect data provenance and latency• Propagation algorithm to analyze end-to-end record impact and

identify records responsible for computation skew

51

Output:Individual records responsible forcomputation skew

PerfDebug

Computation Skew Detection

Data Provenance + Record-Level

Latency

Expensive Record Identification

Input: Spark program, input data

Page 48: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

EvaluationRQ1: What is the impact of applying appropriate remediations?

RQ2: How much overhead does PerfDebug introduce?

RQ3: How accurate is PerfDebug at identifying delay-inducing inputs?

53

Page 49: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

RQ1: Remediation Impact• Three case studies with varying computation skew causes: data skew,

data quality, and expensive UDF. • 1.5X to 16X performance improvement with case-specific fixes.

54

15-27 GB Data10 Workers1 Master

24GB Memory / worker

Page 50: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

NYC Taxi Trips Case Study

56

Worker1

Worker2

(Borough,Cost)

Shuffle

Average by borough

Goal: compute average cost of a taxi ride for each starting borough

27 GB(173M rows)

Page 51: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

NYC Taxi Trips Case StudyWorker1

Worker2

220 s

400 s

15 s

Total runtime: ~7 minutes

20 s57

(Borough,Cost)

Shuffle

Average by borough

27 GB(173M rows)

Page 52: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

NYC Taxi Trips Case StudyWorker1

Worker2

220 s

400 s

15 s

Task times show that data skew is a minor performance factor.

20 s58

(Borough,Cost)

Shuffle

Average by borough

27 GB(173M rows)

Page 53: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

NYC Taxi Trips Case StudyWorker1

Worker2

220 s

400 s

15 s

PerfDebug detects potential computation skew in the first stage.

20 s59

(Borough,Cost)

Shuffle

Average by borough

27 GB(173M rows)

Page 54: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

NYC Taxi Trips Case Study

60

Worker1

Worker2

PerfDebug identifies the outputs with the highest latency and uses provenance to trace the corresponding inputs.

Latency Heatmap(Borough,Cost)

Shuffle

Average by borough

27 GB(173M rows)

Page 55: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

NYC Taxi Trips Case Study

61

Worker1

Worker2

PerfDebug identifies the outputs with the highest latency and uses provenance to trace the corresponding inputs.

Latency Heatmap(Borough,Cost)

Shuffle

Average by borough

27 GB(173M rows)

Page 56: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

NYC Taxi Trips Case Study

62

Worker1

Worker2

PerfDebug identifies the outputs with the highest latency and uses provenance to trace the corresponding inputs.

Latency Heatmap(Borough,Cost)

Shuffle

Average by borough

27 GB(173M rows)

Page 57: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

NYC Taxi Trips Case Study Results• PerfDebug isolates the source of computation skew to a small subset

of inputs: 0.0006%• Inspection reveals that a getBorough UDF consumes majority of task

time.

63

Removal of these records results in ~16X performance improvement.

Page 58: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

RQ2: Instrumentation Overhead• Three benchmarks, ten trials each.• Titian adds ~30% runtime overhead versus Spark [VLDB 2016].• PerfDebug adds ~30% runtime overhead compared to Titian.• Majority of additional overhead due to using persistent storage for

post-mortem debugging, which was not required in Titian.

64

Page 59: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Benchmark Accuracy Precision Improvement Overhead

Movie Ratings 100% 103 X 1.04X

College Students 100% 106 X 1.39X

Weather Analysis 100% 102 X 1.48X

Average 100% 105 X 1.30X

RQ3: Precision and Recall• Three benchmarks, ten trials each.• Use mutation testing to randomly inject an input record with delays.• PerfDebug consistently identified target: 100% precision and recall.• 2-6 orders of magnitude better precision compared to provenance-

only input tracing of outputs using Titian.

65

Page 60: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Conclusion• PerfDebug is a post-mortem performance debugging tool that

combines data provenance and record-level latency instrumentation to precisely pinpoint records which cause computation skew.• Case-specific fixes can yield up to 16X performance improvement.

66

Page 61: Jason Teoh, Muhammad Ali Gulzar, Harry Xu, MiryungKim ... · Computation Skew 9 Term Hello World Big Data Debugging PerfDebug Term Latency Hello World 2 ms Big Data 1 ms Debugging

Related Work• Ernest [NSDI 2016], ARIA [ICAC 2011], Jockey [Eurosys 2012], Starfish

[CIDR 2011]: performance modeling for prediction, but not debugging of computation skew• PerfXplain [VLDB 2012]: job and task comparison for debugging and

explanation with respect to collected metrics.• Titian [VLDB 2016]: data provenance within Apache Spark, used as

foundation for PerfDebug implementation.• Additional works mentioned in paper.

67