35
DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT SCALE Shivaram Venkataraman, Aurojit Panda, Kay Ousterhout, Michael Armbrust, Ali Ghodsi, Michael Franklin, Benjamin Recht, Ion Stoica

DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT SCALE

Shivaram Venkataraman, Aurojit Panda, Kay Ousterhout, Michael Armbrust, Ali Ghodsi, Michael Franklin, Benjamin Recht, Ion Stoica

Page 2: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

STREAMING WORKLOADS

Page 3: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Streaming Trends: Low latency

Results power decisions by machines

Credit card fraud

Disable account

Suspicious user logins

Ask security questions

Slow video load

Direct user to new CDN

Page 4: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Disable stolen accounts Detect suspicious logins

Dynamically adjust application behavior

Streaming Requirements: High throughput

As many as 10s of millions of updates per second Need a distributed system

Page 5: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Distributed Execution Models

Page 6: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Execution models: CONTINUOUS OPERATORS

… …

Group by user, run anomaly detection

Page 7: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Execution models: CONTINUOUS OPERATORS

… …

Group by user, run anomaly detection

Mutable local state

Low latency output

Page 8: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Execution models: CONTINUOUS OPERATORS

… …

Group by user, run anomaly detection

Systems:

Google MillWheel

Streaming DBs: Borealis, Flux etc

Naiad

Mutable local state

Low latency output

Page 9: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Execution models: Micro-batch

… …

… … … … … …

Group by user, run anomaly detection

… …

z

Tasks output state on completion

Output at task granularity

Page 10: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Execution models: Micro-batch

… …

… … … … … …

Group by user, run anomaly detection

… …

z

Tasks output state on completion

Output at task granularity

Dynamic task

scheduling

Adaptability

Straggler mitigation Elasticity

Fault tolerance

Microsoft Dryad

Google FlumeJava

Page 11: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Failure recovery

Page 12: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Failure recovery: continuous operators

Chandy Lamport Async Checkpoint

Checkpointed state

All machines replay from checkpoint

?

Page 13: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Failure recovery: Micro-batch

Task output is periodically

checkpointed

z z z

z

Task boundaries capture task interactions!

Page 14: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Failure recovery: Micro-batch

Parallelize replay

Replay tasks from failed

machine

z z z

z

Task output is periodically

checkpointed

Page 15: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Execution models Continuous operators

Micro-batch

Static scheduling Inflexible

Slow failover

Low latency

Dynamic scheduling Adaptable

Parallel recovery Straggler mitigation

Higher latency Processing granularity Scheduling granularity

Page 16: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Execution models Continuous operators

Micro-batch

Static scheduling Low latency

Dynamic scheduling (coarse granularity)

Higher latency (coarse-grained processing)

Drizzle

Low latency (fine-grained processing)

Dynamic scheduling (coarse granularity)

Page 17: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

inside the scheduler

… … … … … …

… …

Scheduler ?

(1) Decide how to assign

tasks to machines data locality fair sharing

(2) Serialize and send

tasks

… …

Page 18: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

SCHEDULING OVERHEADS

Cluster: 4 core, r3.xlarge machines Workload: Sum of 10k numbers per-core

Median-task time breakdown

0 50

100 150 200 250

4 8 16 32 64 128

Tim

e (m

s)

Machines

Compute + Data Transfer

Task Fetch

Scheduler Delay

Page 19: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

inside the scheduler

… … … … … …

… …

Scheduler ?

(1) Decide how to assign

tasks to machines data locality fair sharing

(2) Serialize and send

tasks

… …

?

Reuse scheduling decisions!

Page 20: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

DRIZZLE

… … … … … …

… …

(1) Pre-schedule reduce tasks

(2) Group schedule micro-batches

Goal: remove frequent

scheduler interaction

Page 21: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

… … …

(1) Pre-schedule reduce tasks

Goal: Remove scheduler involvement for reduce

tasks

Page 22: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

… … …

(1) Pre-schedule reduce tasks

? Goal: Remove scheduler involvement for reduce

tasks

Page 23: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

coordinating shuffles: Existing systems

… …

Metadata describes

shuffle data location

Data fetched from remote

machines

Page 24: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

coordinating shuffles: Pre-scheduling

… …

(1) Pre-schedule reducers

(2) Mappers get metadata

(3) Mappers trigger reducers

Page 25: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

DRIZZLE

… … … … … …

… …

(1) Pre-schedule reduce tasks

(2) Group schedule micro-batches

Goal: wait to return to

scheduler

Page 26: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Group scheduling

… … … … … …

… …

Group of 2 Schedule group of micro-batches

at once

Fault tolerance, scheduling at

group boundaries

Group of 2

Page 27: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

0 50

100 150 200 250 300

4 8 16 32 64 128

Tim

e / I

ter (

ms)

Machines

Baseline Only Pre-Scheduling Drizzle-10 Drizzle-100

Micro-benchmark: 2-stages 100 iterations – Breakdown of pre-scheduling, group-scheduling

In the paper: group size auto-tuning

Page 28: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Evaluation Continuous operators

Micro-batch

Static scheduling Low latency

Dynamic scheduling (coarse granularity)

Higher latency (coarse-grained processing)

Drizzle

Low latency (fine-grained processing)

Dynamic scheduling (coarse granularity)

1. Latency?

2. Adaptability?

Page 29: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

EVALUATION: Latency

Yahoo! Streaming Benchmark Input: JSON events of ad-clicks Compute: Number of clicks per campaign Window: Update every 10s Comparing Spark 2.0, Flink 1.1.1, Drizzle 128 Amazon EC2 r3.xlarge instances

Page 30: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

0 0.2 0.4 0.6 0.8

1

0 500 1000 1500 2000 2500 3000 Event Latency (ms)

Spark

Drizzle

Flink

Streaming BENCHMARK - performance

Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines

Event Latency: Difference between window end, processing end

Page 31: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

0

5000

10000

15000

20000

190 200 210 220 230 240 250 260 270 280 290

Spark Flink Drizzle

Adaptability: FAULT TOLERANCE

Inject machine failure at 240 seconds Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines

31

0

500

1000

1500

2000

190 200 210 220 230

Spark Flink Drizzle

Late

ncy

(ms)

Page 32: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Execution models Continuous operators

Micro-batch

Static scheduling Low latency

Dynamic scheduling Higher latency

Drizzle

Low latency (fine-grained processing)

Dynamic scheduling (coarse-granularity)

Optimization of batches

Optimization of batches

Page 33: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Optimize execution of each micro-batch by pushing down aggregation

INTRA-BATCH QUERY optimization

Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines

0 0.2 0.4 0.6 0.8

1

0 500 1000 1500 2000 2500 3000 Event Latency (ms)

Spark

Drizzle

Flink

Drizzle-Optimized

Page 34: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

EVALUATION

End-to-end Latency Fault tolerance Query optimization Synthetic micro-benchmarks

Video Analytics Shivaram’s Thesis: Iterative ML Algorithms

Yahoo Streaming Benchmark

Throughput Elasticity Group-size tuning

Page 35: DRIZZLE: FAST AND Adaptable STREAM PROCESSING AT …Streaming BENCHMARK - performance Yahoo Streaming Benchmark: 20M JSON Ad-events / second, 128 machines Event Latency: Difference

Conclusion Continuous operators

Micro-batch

Static scheduling Low latency

Dynamic scheduling (coarse granularity)

Higher latency (coarse-grained processing)

Drizzle

Low latency (fine-grained processing)

Dynamic scheduling (coarse granularity)

Optimization of batches

Optimization of batches

Source code: https://github.com/amplab/drizzle-spark

Shivaram is answering questions on sli.do