auto parallelizing stateful distributed streaming
play

Auto-Parallelizing Stateful Distributed Streaming Applica9ons - PowerPoint PPT Presentation

Auto-Parallelizing Stateful Distributed Streaming Applica9ons Sco$ Schneider * , Mar9n Hirzel * , Bugra Gedik + and Kun-Lung Wu * * IBM Research


  1. Auto-­‑Parallelizing ¡Stateful ¡ Distributed ¡Streaming ¡Applica9ons ¡ Sco$ ¡Schneider * , ¡Mar9n ¡Hirzel * , ¡ Bugra ¡Gedik + ¡and ¡Kun-­‑Lung ¡Wu * ¡ * IBM ¡Research ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ + Bilkent ¡University ¡ 1

  2. Big ¡Data ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ 2 ¡

  3. Programming ¡Model ¡ • Streams ¡applica9ons ¡ ¡ – Described ¡as ¡data-­‑flow ¡graphs ¡ • An ¡instance ¡of ¡a ¡flow ¡graph ¡is ¡a ¡job ¡in ¡the ¡system ¡ – Flow ¡graphs ¡consist ¡of ¡ ¡ • Tuples : ¡structured ¡data ¡item ¡ • Operators : ¡Reusable ¡stream ¡analy9cs ¡ • Streams : ¡Series ¡of ¡tuples ¡with ¡a ¡given ¡schema ¡ 3 ¡

  4. Streaming ¡Programming ¡Models ¡ Synchronous ¡ Asynchronous ¡ • Sta9c ¡selec9vity ¡ • Dynamic ¡selec9vity ¡ – e.g., ¡1 ¡: ¡3 ¡ – e.g., ¡1 ¡: ¡[0,1] ¡ for i in range(3): � if input.value > 5: � result = f(i) � submit(result) � submit(result) � – In ¡general, ¡1 ¡: ¡* ¡ ¡ – In ¡general, ¡ m ¡: ¡ n ¡where ¡ m ¡and ¡ • In ¡general, ¡schedules ¡cannot ¡ n ¡are ¡sta9cally ¡known ¡ be ¡sta9c ¡ • Always ¡has ¡sta9c ¡schedule ¡ 4 ¡

  5. InfoSphere Streams Runtime SPL Streams Connections PE PE PE compiler Source Runtime SPL PE source PE Sink PE PE PE PE x86 host x86 host x86 host x86 host x86 host 5

  6. InfoSphere Streams Runtime SPL Streams Connections PE PE PE compiler Source Runtime PE (Job management, PE Sink PE Security, PE Continuous Resource PE PE Management) PE Sink PE PE PE Sink Source PE PE Sink Source x86 host x86 host x86 host x86 host x86 host 6

  7. What ¡we ¡do ¡ composite Main { � type � Entry = int32 uid, rstring server, � rstring msg; � Sum = uint32 uid, int32 total; � graph � stream<Entry> Msgs = ParSource() { � ParSrc ParSrc ParSrc ParSrc param servers: "logs.*.com"; � partitionBy: server; � } � stream<Sum> Sums = Aggregate(Msgs) { � Aggr Aggr Aggr Aggr window Msgs: tumbling, time(5), � partitioned; � param partitionBy: uid; � } � Filter Filter Filter Filter stream<Sum> Suspects = Filter(Sums) { � param filter: total > 100; � } � () as Sink = FileSink(Suspects) { � Sink Sink param file: "suspects.csv"; � } � } � 7 ¡

  8. Overview ¡ Compiler : ¡ • Apply ¡parallel ¡transforma9ons ¡ • Pick ¡rou9ng ¡mechanism ¡(e.g., ¡hash ¡by ¡key) ¡ • Pick ¡ordering ¡mechanism ¡(e.g., ¡seq. ¡numbers) ¡ Stream ¡graph ¡descrip9on ¡ Run:me : ¡ • Replicate ¡segment ¡into ¡channels ¡ • Add ¡split/merge/shuffle ¡as ¡needed ¡ • Enforce ¡ordering ¡ 8 ¡

  9. Transforma9ons ¡& ¡Safety ¡Condi9ons ¡ Parallelize ¡ Parallelize ¡sources ¡ Combine ¡parallel ¡ Rotate ¡ non-­‑source/sink ¡ and ¡sinks ¡ regions ¡ merge ¡and ¡split ¡ • stateless ¡ or ¡ • stateless ¡ or ¡ • stateless ¡ • incompa9ble ¡ par99oned ¡state ¡ par99oned ¡state ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡or ¡ keys ¡ • selec9vity ¡≤ ¡1 ¡ • compa9ble ¡keys ¡ • simple ¡chain ¡ • forwarding ¡ 9

  10. Select ¡Parallel ¡Segments ¡ o 1 o 2 o 3 o 4 o 5 o 6 n.p. k o 7 o 8 o 9 o 10 o 11 o 12 o 13 o 14 n.p. k k,l l l • Can't ¡parallelize ¡ – Operators ¡with ¡>1 ¡fan-­‑in ¡or ¡fan-­‑out ¡ – Punctua9on ¡dependecy ¡later ¡on ¡ • Can't ¡add ¡operator ¡to ¡parallel ¡segment ¡if ¡ – Another ¡operator ¡in ¡segment ¡has ¡co-­‑loca9on ¡ constraint ¡ – Keys ¡don't ¡match ¡ 10 ¡

  11. Compiler ¡ to ¡Run9me ¡ Compiler ¡ compile-time Graph ¡+ ¡unexpanded ¡ parallel ¡regions ¡ ¡ Fully ¡expanded ¡ ¡ graph ¡ submission-time Run9me ¡ Run9me ¡ Run9me ¡ graph ¡ graph ¡ graph ¡ fragment ¡ fragment ¡ fragment ¡ run-time PE ¡ PE ¡ PE ¡ 11 ¡

  12. Run9me ¡ selec:vity ¡= ¡1 ¡ selec:vity ¡≤ ¡1 ¡ selec:vity ¡unknown ¡ no ¡state ¡ round-­‑robin ¡ seqnos ¡& ¡pulses ¡ don't ¡parallelize ¡ par::oned ¡state ¡ seqnos ¡ seqnos ¡& ¡pulses ¡ don't ¡parallelize ¡ unknown ¡state ¡ don't ¡parallelize ¡ don't ¡parallelize ¡ don't ¡parallelize ¡ Operators ¡in ¡parallel ¡segments: ¡ • Forward ¡seqno ¡& ¡pulse ¡ Merge: ¡ • Apply ¡ordering ¡ Split: ¡ policy ¡ • Insert ¡seqno ¡& ¡pulse ¡ • Remove ¡seqno ¡(if ¡ • Rou9ng ¡ there) ¡and ¡drop ¡ pulse ¡(if ¡there) ¡ 12

  13. Merger ¡Ordering ¡ next-­‑heap ¡ next-­‑heap ¡ 13 10 7 22 16 10 0 0 0 next ¡ 5 1 1 1 8 last ¡= ¡4 ¡ last ¡= ¡4 ¡ 15 12 9 6 24 18 12 6 2 2 2 seen-­‑heap ¡ Sequence ¡Numbers ¡ Sequence ¡Numbers ¡and ¡Pulses ¡ Round-­‑Robin ¡ 13 ¡

  14. Scalability ¡ SplitMergeStateful ¡ Aggr Src Aggr Sink Aggr Aggr Aggr Src Aggr Aggr Sink Aggr Aggr SplitShuffleMerge ¡ 14 ¡

  15. Applica9on ¡Kernels ¡ 22 NLP 21.1 Network monitoring ≤ 1 20 Speedup vs. 1 channel PageRank 18 Twitter NLP 16 Twitter NLP 14.4 14 Twitter CEP Parse Match 12.8 ≤ 1 12 Finance Twitter CEP 10 11.4 8 6 Init While Sink 4 Chop MulAdd Add 2 3.2 ≤ 1 0 PageRank 1 2 4 8 16 32 Trades Number of parallel channels Vwap Combine Bargains Quotes ParSrc Aggr Filter Aggr ParSink Filter Project ≤ 1 ≤ 1 ≤ 1 ≤ 1 Network monitoring 15 ¡ Finance

  16. Ques9ons? ¡ 16

  17. Backups ¡ 17

  18. Compiler ¡Changes ¡ Analyze ¡SPL ¡ Operator ¡ code ¡ model ¡ Infer ¡par99on ¡ Select ¡parallel ¡ Fuse ¡ Par99ons ¡ coloca9on ¡ segments ¡ Write ¡ADL ¡ Segments ¡ 18 ¡

  19. Transport ¡Changes ¡ • TCPSender ¡ – Added ¡the ¡ability ¡to ¡send ¡to ¡a ¡subset ¡of ¡ connec9ons ¡on ¡an ¡output ¡port ¡ • Handshake ¡ – Modified ¡to ¡include ¡sender ¡iden99es ¡ • TCPReciever ¡ – Added ¡support ¡for ¡iden9fying ¡which ¡connec9on ¡ has ¡delivered ¡a ¡tuple ¡

  20. Overhead ¡ 20 ¡

  21. Scalability ¡ 21 ¡

  22. Scalability ¡ Aggr Aggr Src Aggr Aggr Sink Aggr Aggr 22 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend