Experiences with Tracing Causality in Networked Services - - PowerPoint PPT Presentation

experiences with tracing causality in networked services
SMART_READER_LITE
LIVE PREVIEW

Experiences with Tracing Causality in Networked Services - - PowerPoint PPT Presentation

Experiences with Tracing Causality in Networked Services Rodrigo Fonseca, Brown Michael Freedman, Princeton George Porter, UCSD April 2010 INM/WREN San


slide-1
SLIDE 1

Experiences ¡with ¡Tracing ¡Causality ¡in ¡ Networked ¡Services ¡

Rodrigo ¡Fonseca, ¡Brown ¡ Michael ¡Freedman, ¡Princeton ¡ George ¡Porter, ¡UCSD ¡ April ¡2010 ¡ ¡ INM/WREN ¡ San ¡Jose, ¡CA ¡

slide-2
SLIDE 2

Which ¡way ¡to ¡Bangalore? ¡

slide-3
SLIDE 3

TroubleshooOng ¡Networked ¡Systems ¡

  • Hard ¡to ¡develop, ¡debug, ¡deploy, ¡troubleshoot ¡
  • No ¡standard ¡way ¡to ¡integrate ¡debugging, ¡

monitoring, ¡diagnosOcs ¡

slide-4
SLIDE 4

Status ¡quo: ¡device ¡centric ¡

... ¡ ... ¡ 28 ¡03:55:38 ¡PM ¡fire... ¡ 28 ¡03:55:38 ¡PM ¡fire... ¡ 28 ¡03:55:38 ¡PM ¡fire... ¡ 28 ¡03:55:38 ¡PM ¡fire... ¡ 28 ¡03:55:38 ¡PM ¡fire... ¡ 28 ¡03:55:38 ¡PM ¡fire... ¡ 28 ¡03:55:38 ¡PM ¡fire... ¡ 28 ¡03:55:39 ¡PM ¡fire... ¡ 28 ¡03:55:39 ¡PM ¡fire... ¡ 28 ¡03:55:39 ¡PM ¡fire... ¡ 28 ¡03:55:39 ¡PM ¡fire... ¡ 28 ¡03:55:39 ¡PM ¡fire... ¡ 28 ¡03:55:39 ¡PM ¡fire... ¡ 28 ¡03:55:39 ¡PM ¡fire... ¡ 28 ¡03:55:39 ¡PM ¡fire... ¡ ... ¡ ... ¡ ... ¡ [04:03:23 ¡2006] ¡[noOce] ¡Dispatch ¡s1... ¡ [04:03:23 ¡2006] ¡[noOce] ¡Dispatch ¡s2... ¡ [04:04:18 ¡2006] ¡[noOce] ¡Dispatch ¡s3... ¡ [04:07:03 ¡2006] ¡[noOce] ¡Dispatch ¡s1... ¡ [04:10:55 ¡2006] ¡[noOce] ¡Dispatch ¡s2... ¡ [04:03:24 ¡2006] ¡[noOce] ¡Dispatch ¡s3... ¡ [04:04:47 ¡2006] ¡[crit] ¡Server ¡s3 ¡down... ¡ ... ¡ ... ¡ ... ¡ ¡ ... ¡ ¡ 72.30.107.159 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:12:58 ¡-­‑0700] ¡"GET ¡/ga ¡ 65.54.188.26 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:13:32 ¡-­‑0700] ¡"GET ¡/rob ¡ 65.54.188.26 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:13:32 ¡-­‑0700] ¡"GET ¡/rob ¡ 65.54.188.26 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:13:32 ¡-­‑0700] ¡"GET ¡/gal ¡ 65.54.188.26 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:13:32 ¡-­‑0700] ¡"GET ¡/gal ¡ 66.249.72.163 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:15:04 ¡-­‑0700] ¡"GET ¡/ga ¡ 66.249.72.163 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:15:07 ¡-­‑0700] ¡"GET ¡/ga ¡ 66.249.72.163 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:15:10 ¡-­‑0700] ¡"GET ¡/ro ¡ 66.249.72.163 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:15:11 ¡-­‑0700] ¡"GET ¡/ga ¡ ... ¡ ... ¡ ... ¡ ¡ ... ¡ ¡ 72.30.107.159 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:12:58 ¡-­‑0700] ¡"GET ¡/ga ¡ 65.54.188.26 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:13:32 ¡-­‑0700] ¡"GET ¡/rob ¡ 65.54.188.26 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:13:32 ¡-­‑0700] ¡"GET ¡/rob ¡ 65.54.188.26 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:13:32 ¡-­‑0700] ¡"GET ¡/gal ¡ 65.54.188.26 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:13:32 ¡-­‑0700] ¡"GET ¡/gal ¡ 66.249.72.163 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:15:04 ¡-­‑0700] ¡"GET ¡/ga ¡ 66.249.72.163 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:15:07 ¡-­‑0700] ¡"GET ¡/ga ¡ 66.249.72.163 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:15:10 ¡-­‑0700] ¡"GET ¡/ro ¡ 66.249.72.163 ¡-­‑ ¡-­‑ ¡[20/Aug/2006:09:15:11 ¡-­‑0700] ¡"GET ¡/ga ¡ ... ¡ ... ¡ ... ¡ ... ¡ LOG: ¡ ¡statement: ¡select ¡oid... ¡ LOG: ¡ ¡statement: ¡SELECT ¡COU... ¡ LOG: ¡ ¡statement: ¡SELECT ¡g2_... ¡ LOG: ¡ ¡statement: ¡select ¡oid... ¡ LOG: ¡ ¡statement: ¡SELECT ¡COU... ¡ LOG: ¡ ¡statement: ¡SELECT ¡g2_... ¡ LOG: ¡ ¡statement: ¡select ¡oid... ¡ LOG: ¡ ¡statement: ¡SELECT ¡COU... ¡ LOG: ¡ ¡statement: ¡SELECT ¡g2_... ¡ LOG: ¡ ¡statement: ¡select ¡oid... ¡ LOG: ¡ ¡statement: ¡select ¡oid... ¡ LOG: ¡ ¡statement: ¡SELECT ¡COU... ¡ LOG: ¡ ¡statement: ¡SELECT ¡g2_... ¡ LOG: ¡ ¡statement: ¡select ¡oid... ¡ LOG: ¡ ¡statement: ¡SELECT ¡COU... ¡ LOG: ¡ ¡statement: ¡SELECT ¡g2_... ¡ LOG: ¡ ¡statement: ¡select ¡oid... ¡ ... ¡ ... ¡

Firewall ¡ Load ¡ ¡ Balancer ¡ Web ¡1 ¡ Web ¡2 ¡ Database ¡

slide-5
SLIDE 5

Status ¡quo: ¡device ¡centric ¡

  • Determining ¡paths: ¡

– Join ¡logs ¡on ¡Ome ¡and ¡ad-­‑hoc ¡idenOfiers ¡

  • Relies ¡on ¡ ¡

– well ¡synchronized ¡clocks ¡ – extensive ¡applicaOon ¡knowledge ¡

  • Requires ¡all ¡operaOons ¡logged ¡to ¡guarantee ¡

complete ¡paths ¡

slide-6
SLIDE 6

This ¡talk ¡

  • Causality ¡Tracking: ¡an ¡alternaOve ¡
  • Many ¡previous ¡frameworks: ¡ ¡

– X-­‑Trace, ¡PIP, ¡Whodunit, ¡Magpie, ¡Google’s ¡Dapper… ¡

  • Experiences ¡integraOng ¡and ¡using ¡X-­‑Trace ¡
slide-7
SLIDE 7

Outline ¡

  • Tracing ¡causality ¡with ¡X-­‑Trace ¡
  • Case ¡studies ¡

– 802.1X ¡AuthenOcaOon ¡Service ¡ – CoralCDN ¡and ¡OASIS ¡anycast ¡service ¡

  • Challenges ¡
  • Conclusion ¡
slide-8
SLIDE 8

X-­‑Trace ¡

  • X-­‑Trace ¡records ¡events ¡in ¡a ¡distributed ¡

execuOon ¡and ¡their ¡causal ¡relaOonship ¡

  • Events ¡are ¡grouped ¡into ¡tasks ¡

– Well ¡defined ¡starOng ¡event ¡and ¡all ¡that ¡is ¡causally ¡ related ¡

  • Each ¡event ¡generates ¡a ¡report, ¡binding ¡it ¡to ¡
  • ne ¡or ¡more ¡preceding ¡events ¡
  • Captures ¡full ¡happens-­‑before ¡relaOon ¡
slide-9
SLIDE 9

X-­‑Trace ¡Output ¡

  • Task ¡graph ¡capturing ¡task ¡execuOon ¡ ¡

– Nodes: ¡events ¡across ¡layers, ¡devices ¡ – Edges: ¡causal ¡relaOons ¡between ¡events ¡

IP ¡ IP ¡ ¡ Router ¡ IP ¡ ¡ Router ¡ IP ¡ TCP ¡1 ¡ Start ¡ TCP ¡1 ¡ End ¡ IP ¡ IP ¡ ¡ Router ¡ IP ¡ TCP ¡2 ¡ Start ¡ TCP ¡2 ¡ End ¡ HTTP ¡ Proxy ¡ HTTP ¡ Server ¡ HTTP ¡ Client ¡

slide-10
SLIDE 10
  • Each ¡event ¡uniquely ¡idenOfied ¡within ¡a ¡task: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

[TaskId, ¡EventId] ¡

  • [TaskId, ¡EventId] ¡propagated ¡along ¡execuOon ¡path ¡
  • For ¡each ¡event ¡create ¡and ¡log ¡an ¡X-­‑Trace ¡report ¡

– Enough ¡info ¡to ¡reconstruct ¡the ¡task ¡graph ¡

Basic ¡Mechanism ¡

IP ¡ IP ¡ ¡ Router ¡ IP ¡ ¡ Router ¡ IP ¡ TCP ¡1 ¡ Start ¡ TCP ¡1 ¡ End ¡ IP ¡ IP ¡ ¡ Router ¡ IP ¡ TCP ¡2 ¡ Start ¡ TCP ¡2 ¡ End ¡ HTTP ¡ Proxy ¡ HTTP ¡ Server ¡ HTTP ¡ Client ¡

f ¡ h ¡ b ¡ a ¡ g ¡ m ¡ n ¡ c ¡ d ¡ e ¡ i ¡ j ¡ k ¡ l ¡

[T, ¡g] ¡ [T, ¡a] ¡ [T, ¡a] ¡

X-­‑Trace ¡Report ¡ TaskID: ¡T ¡ EventID: ¡g ¡ Edge: ¡from ¡a, ¡f ¡

slide-11
SLIDE 11

X-­‑Trace ¡Library ¡API ¡

  • Handles ¡propagaOon ¡within ¡app ¡
  • Threads ¡/ ¡event-­‑based ¡(e.g., ¡libasync) ¡
  • Akin ¡to ¡a ¡logging ¡API: ¡

– Main ¡call ¡is ¡logEvent(message) ¡

  • Library ¡takes ¡care ¡of ¡event ¡id ¡creaOon, ¡binding, ¡

reporOng, ¡etc ¡

  • ImplementaOons ¡in ¡C++, ¡Java, ¡Ruby, ¡Javascript ¡
slide-12
SLIDE 12

Outline ¡

  • Tracing ¡causality ¡with ¡X-­‑Trace ¡
  • Case ¡studies ¡

– 802.1X ¡AuthenOcaOon ¡Service ¡ – CoralCDN ¡and ¡OASIS ¡anycast ¡service ¡

  • Challenges ¡
  • Conclusion ¡
slide-13
SLIDE 13

802.1X ¡AuthenOcaOon ¡Service ¡

Client ¡ AuthenOcator ¡ e.g. ¡Acc. ¡Point ¡ Auth ¡Server ¡ RADIUS ¡ IdenOty ¡Store ¡ e.g. ¡LDAP ¡ EAP ¡ ¡ L2 ¡ RADIUS ¡ Over ¡UDP ¡ LDAP ¡

  • IdenOfied ¡5 ¡common ¡authenOcaOon ¡issues ¡from ¡

vendor ¡logs ¡

  • Added ¡a ¡few ¡X-­‑Trace ¡instrumentaOon ¡points ¡sufficient ¡

to ¡differenOate ¡these ¡faults ¡

  • Introduced ¡faults ¡in ¡a ¡test ¡environment ¡
slide-14
SLIDE 14

802.1X ¡AuthenOcaOon ¡Service ¡

  • InstrumentaOon ¡was ¡easy: ¡

– Nested ¡invocaOons ¡ – No ¡in-­‑task ¡concurrency ¡ – Extensible ¡protocols ¡(RADIUS, ¡LDAP) ¡ – Modular, ¡request-­‑oriented ¡server ¡somware ¡

slide-15
SLIDE 15

802.1X ¡Example ¡Faults ¡

  • Misconfigured ¡Firewall: ¡no ¡LDAP ¡
slide-16
SLIDE 16
  • 802.1X ¡Example ¡Faults ¡
  • Misconfigured ¡Firewall: ¡no ¡LDAP ¡
  • Miscalibrated ¡Timeout ¡Value ¡
  • Key: ¡mulOple ¡correlated ¡vantage ¡points ¡
  • Can ¡help ¡tune ¡Omeout ¡values ¡
slide-17
SLIDE 17

CoralCDN ¡and ¡OASIS ¡

  • Instrumented ¡producOon ¡deployment ¡
  • Heavy ¡use ¡of ¡sampling: ¡ ¡

– 0.1% ¡of ¡requests ¡to ¡CoralCDN ¡traced ¡

  • Leveraged ¡libasync, ¡libarpc ¡X-­‑Trace ¡

instrumentaOon ¡

  • Much ¡more ¡complex ¡program ¡flow ¡

– E.g. ¡windowed ¡parallel ¡RPC ¡calls, ¡variable ¡Omeouts ¡

  • Found ¡bugs, ¡performance ¡problems, ¡clock ¡

skews… ¡

slide-18
SLIDE 18

CoralCDN ¡

CoralCDN Distributed HTTP Cache

slide-19
SLIDE 19
  • 189s: Linux TCP

Timeout connecting to

  • rigin

189 seconds

CoralCDN ¡Response ¡Times ¡

slide-20
SLIDE 20
  • 189s: Linux TCP

Timeout connecting to

  • rigin
  • Slow connection

Proxy -> Client

189 seconds

CoralCDN ¡Response ¡Times ¡

slide-21
SLIDE 21
  • 189s: Linux TCP

Timeout connecting to

  • rigin
  • Slow connection

Proxy -> Client

  • Slow connection

Origin -> Proxy

189 seconds

CoralCDN ¡Response ¡Times ¡

slide-22
SLIDE 22
  • 189s: Linux TCP

Timeout connecting to

  • rigin
  • Slow connection

Proxy -> Client

  • Slow connection

Origin -> Proxy

  • Timeout in RPC, due to

slow Planetlab node!

Same ¡symptoms, ¡very ¡different ¡ causes ¡

189 seconds

CoralCDN ¡Response ¡Times ¡

slide-23
SLIDE 23

Outline ¡

  • Brief ¡X-­‑Trace ¡Intro ¡
  • Case ¡studies ¡

– 802.1X ¡AuthenOcaOon ¡Service ¡ – CoralCDN ¡ – OASIS ¡Anycast ¡Service ¡

  • Challenges ¡
  • Conclusion ¡
slide-24
SLIDE 24

Hidden ¡Channels ¡

  • Example: ¡CoralCDN ¡DNS ¡Calls ¡

foo ¡

DNS Resolver Send Receive

*

resolve(foo,*) Tasks A B C DNS resolve

  • In ¡general: ¡deferral ¡structures ¡

– E.g., ¡queues, ¡thread ¡pools, ¡conOnuaOons ¡ – Store ¡metadata ¡with ¡the ¡structure ¡

  • Omen ¡encapsulated ¡in ¡libraries, ¡high ¡leverage ¡ ¡
slide-25
SLIDE 25

Incidental ¡vs. ¡SemanOc ¡Concurrency ¡

  • Forks ¡and ¡joins ¡ ¡tricky ¡for ¡naïve ¡instrumentaOon ¡

– Non-­‑intuiOve ¡fork ¡ – Incorrect ¡join ¡

start ¡ do(1) ¡ do(2) ¡ do(3) ¡ end ¡ done(1) ¡ done(2) ¡ done(3) ¡

slide-26
SLIDE 26

Incidental ¡vs. ¡SemanOc ¡Concurrency ¡

  • Extra ¡code ¡annotaOon ¡fixes ¡the ¡problem ¡

– Manually ¡change ¡parent ¡of ¡do() ¡events ¡

start ¡ do(1) ¡ do(2) ¡ do(3) ¡ end ¡ done(1) ¡ done(2) ¡ done(3) ¡

slide-27
SLIDE 27

Incidental ¡vs. ¡SemanOc ¡Concurrency ¡

  • Extra ¡code ¡annotaOon ¡fixes ¡the ¡problem ¡

– Manually ¡change ¡parent ¡of ¡do() ¡events ¡ – Manually ¡add ¡edges ¡from ¡done() ¡to ¡end ¡

start ¡ do(1) ¡ do(2) ¡ do(3) ¡ end ¡ done(1) ¡ done(2) ¡ done(3) ¡

slide-28
SLIDE 28

Dealing ¡with ¡Black ¡Boxes ¡

  • Ideal ¡scenario: ¡all ¡components ¡instrumented ¡

with ¡X-­‑Trace ¡

– Log ¡all ¡events ¡

client ¡ proxy ¡ server ¡

slide-29
SLIDE 29

Dealing ¡with ¡Black ¡Boxes ¡

  • Gray-­‑box ¡proxy: ¡passes ¡X-­‑Trace ¡metadata ¡on ¡

– Log ¡events ¡on ¡the ¡client ¡and ¡server ¡ – Layering ¡does ¡this ¡automaOcally ¡

client ¡ proxy ¡ server ¡

slide-30
SLIDE 30

Dealing ¡with ¡Black ¡Boxes ¡

client ¡ proxy ¡ server ¡

  • Black ¡box ¡proxy: ¡drops ¡X-­‑Trace ¡metadata ¡

– No ¡X-­‑Trace ¡events ¡on ¡proxy ¡or ¡server ¡ – Can ¡always ¡trace ¡around ¡black ¡box, ¡in ¡client ¡

slide-31
SLIDE 31

Outline ¡

  • Brief ¡X-­‑Trace ¡Intro ¡
  • Case ¡studies ¡

– 802.1X ¡AuthenOcaOon ¡Service ¡ – CoralCDN ¡ – OASIS ¡Anycast ¡Service ¡

  • Challenges ¡
  • Conclusion ¡
slide-32
SLIDE 32

RevisiOng ¡TroubleshooOng ¡

Device-­‑centric ¡Logs ¡

  • Depends ¡on ¡well ¡sync’d ¡

clocks ¡

  • Joins ¡on ¡ad-­‑hoc ¡

idenOfiers ¡

  • Needs ¡all ¡ops ¡logged ¡for ¡

complete ¡traces ¡

  • No ¡modificaOons ¡to ¡

exisOng ¡code ¡ Task-­‑centric ¡traces ¡

  • Does ¡not ¡depend ¡on ¡

clocks ¡(can ¡actually ¡fix ¡ them) ¡

  • DeterminisOc ¡joins ¡on ¡

standardized ¡ids ¡

  • Sample-­‑based ¡tracing ¡

possible ¡

  • Requires ¡

instrumentaOon ¡

slide-33
SLIDE 33

X-­‑Trace ¡InstrumentaOon ¡

  • InstrumenOng ¡is ¡easy ¡in ¡most ¡cases ¡
  • A ¡few ¡key ¡libraries ¡go ¡a ¡long ¡way ¡
  • Can ¡be ¡done ¡iteraOvely ¡

– Refining ¡expectaOons ¡(a ¡la ¡Pip) ¡

  • ParOal ¡annotaOon ¡sOll ¡useful ¡
  • Independent ¡instrumentaOon ¡feasible ¡
  • Huge ¡benefits ¡
slide-34
SLIDE 34

Conclusions ¡

  • Simple, ¡uniform ¡task ¡graphs ¡useful ¡in ¡

debugging, ¡troubleshooOng, ¡diagnosOcs ¡

  • InstrumentaOon ¡is ¡feasible ¡

Causal ¡tracing ¡should ¡be ¡a ¡first-­‑class ¡concept ¡in ¡ networked ¡systems ¡

slide-35
SLIDE 35

Thank ¡you ¡

  • More ¡details ¡on ¡paper ¡
  • For ¡more ¡info: ¡

www.x-­‑trace.net ¡ www.coralcdn.org ¡