Self Healing in Streaming Systems #UW Database Day Dec 2nd, 2016 - - PowerPoint PPT Presentation

self healing in streaming systems
SMART_READER_LITE
LIVE PREVIEW

Self Healing in Streaming Systems #UW Database Day Dec 2nd, 2016 - - PowerPoint PPT Presentation

Self Healing in Streaming Systems #UW Database Day Dec 2nd, 2016 Karthik Ramasamy Twi/er @karthikz 2 What is self healing? A self healing system adapts itself as their environmental condi8ons


slide-1
SLIDE 1

Self Healing in Streaming Systems

#UW Database Day Dec 2nd, 2016

Karthik ¡Ramasamy ¡

Twi/er

@karthikz

slide-2
SLIDE 2

2

What is self healing?

A ¡self ¡healing ¡system ¡adapts ¡itself ¡as ¡their ¡ environmental ¡condi8ons ¡change ¡and ¡con8nue ¡to ¡produce ¡ results

slide-3
SLIDE 3

3

Why?

Value&of&Data&to&Decision/Making& Time& Preven8ve/& Predic8ve& Ac8onable& Reac8ve& Historical&

Real%& Time& Seconds& Minutes& Hours& Days&

Tradi8onal&“Batch”&&&&&&&&&&&&&&& Business&&Intelligence&

Informa9on&Half%Life& In&Decision%Making&

Months&

Time/cri8cal& Decisions&

[1] ¡Courtesy ¡Michael ¡Franklin, ¡BIRTE, ¡2015. ¡

slide-4
SLIDE 4

4

Why?

G

Impact of downtime popular event such as Super Bowl Oscars, etc

Ü

Impact of not honoring an SLA leading to penalty payments

  • Engineers & SRE burnt
  • ut attending to

incidents

increased productivity loss of revenue sla violations quality of life

With reduced incidents, engineers can focus on actual development

s

slide-5
SLIDE 5

5

Real-Time Budget

BATCH

high throughput

> 1 hour

monthly active users relevance for ads adhoc queries

REAL TIME

low latency

< 1 ms

Financial Trading ad impressions count hash tag trends approximate

10 ms - 1 sec

Near Real Time

latency sensitive

< 500 ms

fanout Tweets search for Tweets deterministic workflows

OLTP

slide-6
SLIDE 6

6

Streaming Variants

STREAM PROCESSING

Analyze ¡and ¡act ¡on ¡data ¡ with ¡con8nuous ¡queries ¡

STREAM WORKFLOWS

Con8nuous ¡ process ¡ of ¡ events ¡ for ¡a ¡determinis8c ¡workflow

H C

STREAM ANALYTICS

Con8nuously ¡analyze ¡data ¡ using ¡mathema8cal ¡& ¡ sta8s8cal ¡techinques

H

slide-7
SLIDE 7

7

Heron Topology

% % % % %

Spout 1 Spout 2 Bolt 1 Bolt 2 Bolt 3 Bolt 4 Bolt 5

slide-8
SLIDE 8

8

Heron Topology - Physical Execution

% % % % %

Spout 1 Spout 2 Bolt 1 Bolt 2 Bolt 3 Bolt 4 Bolt 5

% % % % % % % % % %

slide-9
SLIDE 9

9

Heron

Topology 1

Topology Submission

Scheduler Topology 2 Topology N

slide-10
SLIDE 10

10

Heron Topology Components

Topology Master

ZK Cluster

Stream Manager

I1 I2 I3 I4

Stream Manager

I1 I2 I3 I4

Logical Plan, Physical Plan and Execution State Sync Physical Plan

DATA CONTAINER DATA CONTAINER

Metrics Manager Metrics Manager

MASTER CONTAINER

slide-11
SLIDE 11

11

Heron @Twitter

> ¡500 ¡Real ¡ Time ¡Jobs 500 ¡Billions ¡Events/Day ¡ PROCESSED 25-­‑200 ¡ MS ¡ latency

slide-12
SLIDE 12

12

Common Operational Issues

01 02 03 Slow Hosts Network Issues Data Skew

/ .

slide-13
SLIDE 13

13

Slow Hosts

Memory Parity Errors Impeding Disk Failures Lower GHZ

G

  • g
slide-14
SLIDE 14

14

Heron Backpressure

% %

S1 B2 B3

%

B4

slide-15
SLIDE 15

15

Stream Manager

S1 B2 B3

Stream Manager Stream Manager Stream Manager Stream Manager

S1 B2 B3 B4 S1 B2 B3 S1 B2 B3 B4 B4

slide-16
SLIDE 16

S1 S1 S1 S1 S1 S1 S1 S1

16

Spout Backpressure

B2 B3

Stream Manager Stream Manager Stream Manager Stream Manager

B2 B3 B4 B2 B3 B2 B3 B4 B4

Can ¡we ¡do ¡beWer?

slide-17
SLIDE 17

17

Network

Network Slowness Network Partitioning

G

g

slide-18
SLIDE 18

18

Network Slowness

Delays processing Data is accumulating Timeliness of results is affected

I

slide-19
SLIDE 19

19

Network Slowness

Can ¡we ¡do ¡beWer?

slide-20
SLIDE 20

20

Network Partitioning

Stream Manager

Topology Master Topology Master Scheduler

Stream Manager Stream Manager

Scheduler

Stream Manager

slide-21
SLIDE 21

21

Network Partitioning

New Master Container Acquiring Mastership in ZooKeeper fails Master Container Dies

G

  • g

Topology Master Scheduler

slide-22
SLIDE 22

22

Network Partitioning

TMaster thinks data container failed Waits for the scheduler to reschedule new data container Never happens

G

  • g

Stream Manager

Topology Master

slide-23
SLIDE 23

23

Network Partitioning

Cannot exchange data Data accumulates Chaos ensues!

G

  • g

Stream Manager Stream Manager

Can ¡we ¡do ¡beWer?

slide-24
SLIDE 24

24

Network Partitioning

New data container spawned TMaster realizes two data containers report as the same Does not accept the new one and eventually it dies

G

  • g

Scheduler

Stream Manager

slide-25
SLIDE 25

25

Data Skew

Multiple Keys

Several ¡keys ¡map ¡into ¡ single ¡instance ¡and ¡their ¡ count ¡is ¡high

Single Key

Single ¡ key ¡ maps ¡ into ¡ a ¡ instance ¡and ¡its ¡count ¡is ¡high

H C

slide-26
SLIDE 26

26

Data Skew - Multiple Keys

% % % % %

Spout 1 Spout 2 Bolt 1 Bolt 2 Bolt 3 Bolt 4 Bolt 5

% % % % % % % % % % % %

slide-27
SLIDE 27

27

Data Skew - Single Key

% % % % %

Spout 1 Spout 2 Bolt 1 Bolt 2 Bolt 3 Bolt 4 Bolt 5

% % % % % % % % % % % % %

What ¡happens ¡if ¡the ¡skew ¡is ¡temporary?

slide-28
SLIDE 28

28

Rack Failures

Multiple Rack

Outage ¡of ¡several ¡racks ¡ simultaneously

Single Rack

Outage ¡of ¡a ¡single ¡rack

H C

slide-29
SLIDE 29

29

Rack Local vs Rack Diversity

Rack Local Rack Diversity

Advantage ¡of ¡reduced ¡network ¡ latency ¡and ¡high ¡p2p ¡bandwidth Higher ¡network ¡latency ¡and ¡shared ¡ bandwidth

slide-30
SLIDE 30

30

Single Rack Failure

Rack failure

If ¡job ¡is ¡rack ¡local ¡en8re ¡job ¡is ¡down ¡and ¡needs ¡ to ¡be ¡rescheduled

Impact on real timeliness

Depends ¡on ¡the ¡applica8on

{

  • Rack Local
slide-31
SLIDE 31

31

Single Rack Failure

Rack Diversity

Rack failure

If ¡job ¡is ¡rack ¡diverse ¡impact ¡is ¡minimal

Impact on real timeliness

Is ¡affected ¡less ¡-­‑ ¡depending ¡on ¡how ¡many ¡ containers ¡are ¡running

{

slide-32
SLIDE 32

32

Conclusion

  • Self ¡healing ¡is ¡important ¡in ¡Streaming ¡systems

Key ¡opera8onal ¡issues ¡-­‑ ¡Slow ¡hosts, ¡network ¡and ¡data ¡skew These ¡requirements ¡make ¡the ¡streaming ¡systems ¡more ¡complex

G

slide-33
SLIDE 33

33

Interested in Heron?

CONTRIBUTIONS ARE WELCOME!

https://github.com/twitter/heron http://heronstreaming.io

HERON IS OPEN SOURCED FOLLOW US @HERONSTREAMING

slide-34
SLIDE 34

34

WHAT WHY WHERE WHEN WHO HOW

Any Questions ???

slide-35
SLIDE 35

35

@karthikz

Thanks For Listening

slide-36
SLIDE 36

36

Detections and Resolutions

Affects ¡real-­‑8me ¡ ¡ (depends ¡on ¡applica8on ¡tolerance) ¡ Keeps ¡up ¡with ¡real-­‑8me Full ¡manual ¡interven8on N/A Proac8ve Reac8ve

DetecDons

Lazy Instant

ResoluDons