In-situ MapReduce for Log Processing Dionysios Logothe9s, - - PowerPoint PPT Presentation

in situ mapreduce for log processing
SMART_READER_LITE
LIVE PREVIEW

In-situ MapReduce for Log Processing Dionysios Logothe9s, - - PowerPoint PPT Presentation

In-situ MapReduce for Log Processing Dionysios Logothe9s, Kevin Webb, Kenneth Yocum UC San Diego Chris Trezzo Salesforce Inc. USENIX Annual Technical


slide-1
SLIDE 1

In-­‑situ ¡MapReduce ¡for ¡Log ¡ Processing ¡

Dionysios ¡Logothe9s, ¡Kevin ¡Webb, ¡Kenneth ¡Yocum ¡

UC ¡San ¡Diego ¡

Chris ¡Trezzo ¡

Salesforce ¡Inc. ¡

USENIX ¡Annual ¡Technical ¡Conference ¡ June ¡2011 ¡

slide-2
SLIDE 2

Log ¡analy9cs ¡

2 ¡

  • Data ¡centers ¡with ¡1000s ¡of ¡servers ¡
  • Genera9ng ¡logs ¡with ¡valuable ¡informa9on ¡
  • Data-­‑intensive ¡compu9ng: ¡Store ¡and ¡analyze ¡

TBs ¡of ¡logs ¡ Examples: ¡

  • Click ¡logs: ¡ad-­‑targe9ng, ¡personaliza9on ¡
  • Social ¡media ¡feeds: ¡brand ¡monitoring ¡
  • Purchase ¡logs: ¡fraud ¡detec9on ¡
  • System ¡logs: ¡anomaly ¡detec9on, ¡debugging ¡
slide-3
SLIDE 3

Log ¡analy9cs ¡today ¡

  • “Store-­‑first-­‑query-­‑later” ¡

– Migrate ¡logs ¡to ¡dedicated ¡clusters ¡

Problems: ¡

  • Scale ¡

– e.g. ¡Facebook ¡collects ¡100TB ¡a ¡day! ¡ – Data ¡migra9on ¡stresses ¡network ¡and ¡disks ¡

  • Failures ¡

– e.g. ¡server ¡is ¡unreachable ¡ – Delay ¡analysis ¡or ¡process ¡incomplete ¡data ¡

  • Timeliness ¡

– e.g. ¡ ¡long ¡data ¡migra9on ¡9mes ¡ – Hinders ¡real-­‑9me ¡apps: ¡ad-­‑targe9ng, ¡fraud ¡detec9on ¡ Store ¡first… ¡ … ¡query ¡later ¡

3 ¡

MapReduce ¡

Dedicated ¡cluster ¡ Servers ¡

slide-4
SLIDE 4

In-­‑situ ¡MapReduce ¡(iMR) ¡

Idea: ¡

  • Move ¡analysis ¡to ¡the ¡servers ¡
  • MapReduce ¡for ¡con9nuous ¡data ¡
  • Ability ¡to ¡trade ¡fidelity ¡for ¡latency ¡

Op9mized ¡for: ¡

  • Highly ¡selec9ve ¡workloads ¡

– e.g. ¡up ¡to ¡80% ¡data ¡filtered ¡or ¡summarized! ¡

  • Online ¡analy9cs ¡

– e.g. ¡ ¡Ad ¡re-­‑targe9ng ¡based ¡on ¡most ¡recent ¡clicks ¡

4 ¡

MapReduce ¡

Dedicated ¡cluster ¡ Servers ¡

slide-5
SLIDE 5

An ¡iMR ¡query ¡

The ¡same: ¡

  • MapReduce ¡API ¡

– map(r) ¡ ¡{k,v} ¡: ¡ ¡extract/filter ¡data ¡ – reduce( ¡{k, ¡v[]} ¡) ¡ ¡ ¡v’ ¡: ¡data ¡aggrega9on ¡ – combine( ¡{k, ¡v[]} ¡) ¡ ¡v’ ¡: ¡early, ¡par9al ¡aggrega9on ¡

The ¡new: ¡

  • Provides ¡con9nuous ¡results ¡
  • Because ¡logs ¡are ¡con9nuous ¡
slide-6
SLIDE 6

Con9nuous ¡MapReduce ¡

  • iMR ¡input ¡is ¡an ¡infinite ¡stream ¡of ¡logs ¡
  • Bound ¡input ¡with ¡sliding ¡windows: ¡

– Range ¡of ¡data ¡ ¡ – Update ¡frequency ¡ – e.g. ¡Process ¡user ¡clicks ¡over ¡the ¡last ¡60’’… ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡and ¡update ¡analysis ¡every ¡15’’ ¡

  • Nodes ¡output ¡stream ¡of ¡results, ¡one ¡for ¡each ¡window ¡
  • Analysis ¡con9nuously ¡updated ¡with ¡new ¡data ¡

6 ¡

Map ¡ Combine ¡

… ¡

0’’ ¡ 60’’ ¡ 30’’ ¡ 90’’ ¡ Log ¡entries ¡ Time ¡

Reduce ¡

slide-7
SLIDE 7

Processing ¡windows ¡in-­‑network ¡

  • Aggrega9on ¡trees ¡for ¡efficiency ¡

– Distribute ¡processing ¡load ¡ – Reduce ¡network ¡traffic ¡

Problem: ¡

  • Overlapping ¡data ¡

– Processed ¡mul9ple ¡9mes: ¡wastes ¡CPU ¡ – Sent ¡to ¡the ¡root ¡mul9ple ¡9mes: ¡wastes ¡network ¡

7 ¡ 7 ¡

Reduce ¡

Query ¡root ¡

Map ¡ Combine ¡

log ¡entries ¡

Map ¡ Combine ¡

log ¡entries ¡ Combine ¡ windows ¡ ¡ in-­‑network ¡

Map ¡ Combine ¡

Overlapping ¡data ¡

slide-8
SLIDE 8

Efficient ¡processing ¡with ¡panes ¡

  • Eliminate ¡redundant ¡work ¡
  • Divide ¡window ¡into ¡panes ¡(sub-­‑windows) ¡
  • Each ¡pane ¡is ¡processed ¡and ¡sent ¡only ¡once ¡
  • Root ¡combines ¡panes ¡to ¡produce ¡window ¡
  • Saves ¡CPU ¡& ¡network ¡resources, ¡faster ¡

analysis ¡

8 ¡

Map ¡ Combine ¡

… ¡

0’’ ¡ 60’’ ¡ 30’’ ¡ 90’’ ¡ Time ¡ P1 ¡ P2 ¡ P3 ¡ P1 ¡ P2 ¡ P3 ¡ P4 ¡ P4 ¡

Reduce ¡

slide-9
SLIDE 9

Impact ¡of ¡data ¡loss ¡on ¡analysis ¡

  • Servers ¡may ¡get ¡overloaded ¡or ¡fail ¡
  • Apps ¡may ¡have ¡latency ¡requirements ¡
  • Data ¡loss ¡is ¡unavoidable ¡to ¡ensure ¡9meliness ¡

Challenges: ¡

  • Characterize ¡incomplete ¡results ¡
  • Allow ¡users ¡to ¡trade ¡fidelity ¡for ¡latency ¡

9 ¡ Map ¡

Combine ¡

P1 ¡ P2 ¡ P3 ¡ P4 ¡

Reduce ¡

X

? ¡

slide-10
SLIDE 10

Quan9fying ¡data ¡fidelity ¡

  • Data ¡are ¡naturally ¡distributed ¡across: ¡

– Space ¡(server ¡nodes) ¡ – Time ¡(processing ¡window) ¡

  • Panes ¡describe ¡temporal ¡and ¡spa9al ¡nature ¡of ¡data ¡
  • C2 ¡metric: ¡annotates ¡result ¡windows ¡with ¡a ¡“scoreboard” ¡

– Marks ¡successfully ¡received ¡panes ¡

10 ¡ 10 ¡

N1 ¡ N2 ¡ N3 ¡ N4 ¡ P1 ¡ P2 ¡ P3 ¡ P4 ¡

Time ¡ Space ¡

slide-11
SLIDE 11

Trading ¡fidelity ¡for ¡latency ¡

  • Use ¡C2 ¡spec ¡to ¡trade ¡fidelity ¡for ¡latency ¡

Users ¡may ¡specify: ¡

  • Maximum ¡latency ¡requirement ¡

– e.g. ¡process ¡window ¡within ¡60sec ¡

  • Minimum ¡fidelity ¡

– e.g. ¡at ¡least ¡50% ¡of ¡the ¡total ¡data ¡

  • Different ¡ways ¡to ¡meet ¡minimum ¡fidelity ¡

– Impact ¡latency ¡and ¡accuracy ¡of ¡analysis ¡

  • We ¡iden9fied ¡4 ¡useful ¡classes ¡of ¡C2 ¡specifica9ons ¡

11 ¡

N1 ¡ N2 ¡ N3 ¡ N4 ¡ P1 ¡ P2 ¡ P3 ¡ P4 ¡ N1 ¡ N2 ¡ N3 ¡ N4 ¡ P1 ¡ P2 ¡ P3 ¡ P4 ¡

Time ¡ Space ¡ Time ¡ Space ¡

slide-12
SLIDE 12

Minimizing ¡result ¡latency ¡

  • Minimum ¡fidelity ¡with ¡earlier ¡results ¡

– e.g. ¡50% ¡of ¡the ¡data ¡

  • Gives ¡freedom ¡to ¡decrease ¡latency ¡

– Returns ¡the ¡earliest ¡data ¡available ¡ – e.g. ¡data ¡from ¡the ¡fastest ¡servers ¡

  • Appropriate ¡for ¡uniformly ¡distributed ¡events ¡

– Accurately ¡summarizes ¡rela9ve ¡event ¡frequencies ¡

12 ¡

N1 ¡ N2 ¡ N3 ¡ N4 ¡ P1 ¡ P2 ¡ P3 ¡ P4 ¡

slide-13
SLIDE 13

Sampling ¡non-­‑uniform ¡events ¡

  • Minimum ¡fidelity ¡with ¡random ¡sampling ¡

– e.g. ¡random ¡50% ¡of ¡the ¡data ¡

  • Less ¡freedom ¡to ¡decrease ¡latency ¡

– Included ¡data ¡may ¡not ¡be ¡the ¡first ¡available ¡

  • Appropriate ¡even ¡for ¡non-­‑uniform ¡data ¡

– Reproduces ¡rela9ve ¡occurrence ¡of ¡events ¡

13 ¡

N1 ¡ N2 ¡ N3 ¡ N4 ¡ P1 ¡ P2 ¡ P3 ¡ P4 ¡

slide-14
SLIDE 14

Correla9ng ¡events ¡across ¡9me ¡and ¡space ¡

  • Leverage ¡knowledge ¡about ¡data ¡distribu9on ¡

Temporal ¡completeness: ¡

  • Include ¡all ¡data ¡from ¡a ¡node ¡or ¡no ¡data ¡at ¡all ¡

– e.g. ¡all ¡data ¡from ¡50% ¡of ¡the ¡nodes ¡

  • Useful ¡when ¡events ¡are ¡local ¡to ¡a ¡node ¡

– e.g. ¡coun9ng ¡events ¡on ¡a ¡per ¡node ¡basis ¡

Spa9al ¡completeness: ¡

  • Each ¡pane ¡contains ¡data ¡from ¡all ¡nodes ¡
  • Useful ¡for ¡correla9ng ¡events ¡across ¡servers ¡

– e.g ¡ ¡click ¡sessioniza9on ¡

14 ¡

N1 ¡ N2 ¡ N3 ¡ N4 ¡ P1 ¡ P2 ¡ P3 ¡ P4 ¡ N1 ¡ N2 ¡ N3 ¡ N4 ¡ P1 ¡ P2 ¡ P3 ¡ P4 ¡

slide-15
SLIDE 15

Prototype ¡

  • Builds ¡upon ¡Mortar ¡distributed ¡stream ¡processor ¡

[Logothe9s ¡et ¡al., ¡USENIX’08] ¡

– Sliding ¡windows ¡ – In-­‑network ¡aggrega9on ¡trees ¡

  • Extended ¡to ¡support: ¡

– MapReduce ¡API ¡ – Paned-­‑based ¡processing ¡ – Fault ¡tolerance ¡mechanisms: ¡operator ¡restart, ¡adap9ve ¡ data ¡rou9ng ¡

15 ¡

slide-16
SLIDE 16

Processing ¡data ¡in-­‑situ ¡

  • Analysis ¡co-­‑located ¡with ¡client-­‑facing ¡services ¡
  • Limited ¡CPU ¡resources ¡for ¡log ¡analysis ¡
  • Goal: ¡use ¡available ¡resources ¡intelligently ¡
  • Load ¡shedding ¡mechanism ¡

– Nodes ¡monitor ¡local ¡processing ¡rate ¡ – Shed ¡panes ¡that ¡cannot ¡be ¡processed ¡on ¡9me ¡

  • Increases ¡result ¡fidelity ¡under ¡9me ¡and ¡resource ¡

constraints ¡

16 ¡

slide-17
SLIDE 17

Evalua9on ¡

  • System ¡scalability ¡
  • Usefulness ¡of ¡C2 ¡metric ¡

– Understanding ¡incomplete ¡results ¡ – Trading ¡fidelity ¡for ¡latency ¡ – Applica9ons: ¡

  • Click-­‑stream ¡sessioniza9on ¡
  • HDFS ¡failure ¡detec9on ¡
  • Processing ¡data ¡in-­‑situ ¡

– Improving ¡fidelity ¡under ¡load ¡with ¡load ¡shedding ¡ – Minimize ¡impact ¡on ¡services ¡

17 ¡

slide-18
SLIDE 18

Exploring ¡fidelity-­‑latency ¡tradeoffs ¡

  • Hadoop ¡DFS ¡anomaly ¡detec9on ¡algorithm ¡[Tan ¡et ¡
  • al. ¡WASL’08] ¡
  • Query: ¡compute ¡distribu9on ¡of ¡service ¡9mes ¡

for ¡every ¡HDFS ¡server, ¡to ¡detect ¡outliers ¡

  • Data: ¡HDFS ¡log ¡trace ¡from ¡30-­‑node ¡cluster ¡

18 ¡

slide-19
SLIDE 19

Exploring ¡fidelity-­‑latency ¡tradeoffs ¡

  • Data ¡loss ¡affects ¡accuracy ¡of ¡distribu9on ¡
  • Report: ¡probability ¡observed ¡distribu9on ¡is ¡

incorrect ¡

  • Temporal ¡completeness ¡

– Distribu9ons ¡are ¡100% ¡accurate ¡ – Computed ¡on ¡per ¡server ¡basis ¡

  • Spa9al ¡completeness ¡& ¡random ¡sampling ¡

– Poor ¡results ¡if ¡more ¡than ¡20% ¡data ¡lost ¡ – Reduce ¡latency ¡by ¡>25% ¡

  • C2 ¡allows ¡to ¡trade ¡fidelity ¡for ¡lower ¡latency ¡

19 ¡

0 ¡ 0.2 ¡ 0.4 ¡ 0.6 ¡ 0.8 ¡ 1 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ Probability ¡ Data ¡volume ¡(%) ¡ Random ¡ Spa9al ¡completeness ¡ Temporal ¡completeness ¡ 0 ¡ 100 ¡ 200 ¡ 300 ¡ 400 ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ Latency ¡(sec) ¡ Data ¡volume ¡(%) ¡ Temporal ¡completeness ¡ Random ¡ Spa9al ¡completeness ¡

100% ¡accuracy ¡ 25% ¡decrease ¡

slide-20
SLIDE 20

In-­‑situ ¡performance ¡

  • iMR ¡side-­‑by-­‑side ¡with ¡a ¡real ¡service ¡(Hadoop) ¡
  • n ¡a ¡10-­‑node ¡cluster ¡
  • iMR ¡executes ¡a ¡word ¡count ¡query ¡
  • Latency ¡requirement ¡set ¡to ¡60sec. ¡
  • Vary ¡CPU ¡allocated ¡to ¡iMR ¡(niceness) ¡
  • Report: ¡

– Result ¡fidelity ¡ – Hadoop ¡performance ¡(job ¡throughput) ¡

  • Shedding ¡improves ¡fidelity ¡by ¡560% ¡! ¡
  • Hadoop ¡performance ¡drops ¡by ¡<11% ¡
  • Liwle ¡impact ¡on ¡Hadoop, ¡while ¡s9ll ¡delivering ¡

useful ¡results ¡

20 ¡

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ 8 ¡ 9 ¡ 10 ¡ Fidelity ¡(%) ¡ Niceness ¡ Shedding ¡ No ¡shedding ¡ 0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ 8 ¡ 9 ¡ 10 ¡ RelaAve ¡performance ¡(%) ¡ Niceness ¡

560% ¡ <11% ¡overhead ¡

slide-21
SLIDE 21

Conclusion ¡

  • In-­‑situ ¡architecture ¡processes ¡logs ¡at ¡the ¡sources, ¡avoids ¡bulk ¡

data ¡transfers, ¡reduces ¡analysis ¡9me ¡

  • Model ¡allows ¡incomplete ¡data ¡under ¡failures ¡or ¡server ¡load, ¡

provides ¡9mely ¡analysis ¡

  • C2 ¡metric ¡helps ¡understand ¡incomplete ¡data ¡and ¡trade ¡fidelity ¡

for ¡latency ¡

  • Pro-­‑ac9vely ¡sheds ¡load, ¡improves ¡data ¡fidelity ¡under ¡resource ¡

and ¡9me ¡constraints ¡

21 ¡