Docsity

Operator Scheduling in Data Stream Managers: Minimizing Cost and Memory - Prof. David E. M, Study notes of Computer Science

Partial preview of the text

Download Operator Scheduling in Data Stream Managers: Minimizing Cost and Memory - Prof. David E. M and more Study notes Computer Science in PDF only on Docsity!

10/16/^

Data Streams: Lecture 7

CS 410/510 Data Streams Lecture 7: Operator Scheduling in a Data Stream Manager

Kristin Tufte, David Maier Thanks to: U

ğur Çetintemel, Don

Carney

10/16/^

Data Streams: Lecture 7

Aurora Operator Scheduling „^ “Which Operators to Schedule” „^ “In which order to Schedule theOperators” „^ “How many tuples to process at eachexecution step”

Operator Scheduling in a Data StreamManager, Carney, et al.

10/16/^

Data Streams: Lecture 7

Aurora: Basic Model [Carney^ et al

., VLDB02]

Query^ Query

...

...

Query^ Query

...

Query^ Query

... ...

... ... „^ Each application provides:^ ‰^ A query over input data streams^ ‰^ Quality-of-Service (QoS) specifications

App^

QoS App^

QoS App^

QoS

DataStreams

From: U. ÇetintemelMDM

10/16/^

Data Streams: Lecture 7

Looking Closer

App^

QoS ... ...

... ... App^

QoS App^

QoS

σ^ σ σ^ σ σσ

MapMap Map Map

σσ σ σ AggregateAggregate μ^

App^

QoS

σ^ σ σσ Data Streams •BoxesBoxes^ •

→^ operators/user-→operators/user

-defined functionsdefined functions

•ArcsArcs^ •

→^ tuple queues→tuple queues• data can be made persistentdata can be made persistent - •

-> access to historical data> access to historical data

-^ snapshot (ad hoc) queries^ • snapshot (ad hoc) queries

From: U.From: U.^ ÇÇetintemeletintemelMDM04 MDM

10/16/^

Data Streams: Lecture 7

Execution Model^ „^ Traditional thread-driven execution:^ ‰^ Use a thread per query, per operator, etc.^ ‰^ Not scalable (large number threads, cache misses,thread context switches)^ ‰^ Little control over resources^ „^ Aurora: state-based execution^ ‰^ Scheduler watches system state and maintains a singleexecution queue^ ‰^ Fine-grained resource allocation^ ‰^ Accommodates application-specific QoS (can controldetermination of fairness)^ ‰^ Enables effective batching of tuples and operators

10/16/^

Data Streams: Lecture 7

Scheduler Design^ „^ Single execution queue shared by smallnumber of worker threads^ „^ Scheduler loops continuously^ ‰^ pick the box(es) to run next^ ‰^ pick the number of tuples to be consumedby each box^ ‰^ insert into the execution queue^ „^ Scheduler must be intelligent and lowoverhead

10/16/^

Data Streams: Lecture 7

Aurora: Run-Time Architecture

Scheduler

ExecutionThreads Run-time StatsMonitor

. .. Buffer Storage Manager^ Persistent Store

… q^1

… q^2

… q i

… q^1

…

. .. q n … q^2

σ σ^ μ^.^. .. ..^ ∪^ ∪

inputs^ outputs^ Router Embedded DB Catalog

External^ DBs

Loadshedder

Meta-data^ Data From: U. ÇetintemelMDM

10/16/^

Data Streams: Lecture 7

Superbox Processing „^ Superbox – set of boxes grouped together for scheduling^ ‰^ Reduce scheduling overheads^ ‰^ Reduce storage manager access „^ Issues:^ ‰^ Which boxes to group together in a super box (application)^ ‰^ Which superbox to schedule (e.g. round robin) „^ Solution: Application-at-a-time (AAAT)^ ‰^ One superbox for each query tree^ ‰^ # superboxes = # continuous queries or applications „^ Paper considers only static AAAT scheduling (though dynamicimplemented also „^ Seem to do round-robin between super boxes

10/16/^

Data Streams: Lecture 7

Minimum-Cost (MC) Traversal „^ Minimize processing costs^ ‰^ Processing costs are:^ „^

Tuple processing costs at each box (p) „ Box switches (o) ‰ Can’t do anything about processing costs at box(will process all queued tuples) ‰ Can do something about box switches ‰ Minimize box switches (execute each box once)

p = box processing cost, o = box change overhead Cost: 15p + 6o

Average Latency: 12.5p + 6o

10/16/^

Data Streams: Lecture 7

Minimum-Latency (ML) Traversal „^ Minimize latency^ ‰^ Output tuples as soon as possible^ ‰^ Put a priority on boxes with low selectivity (outputlots of tuples per input) „^ Calculate output cost of each box „^ Execute box with current lowest cost „^ More box calls than MC, but outputs tuplesearlier

10/16/^

Data Streams: Lecture 7

ML Traversal Example p = box processing cost, o = box change overheadAll boxes have selectivity = 1

(1 output tuple for every input tuple)

o_sel(b) =

∏^ sel(k) output_cost(b) =

Σ^ cost(k)/o_sel(k) As selectivity increases, cost increases.Selects boxes that have low cost and high probability of producingresults

b4 b5 b

b^

b b k in D(b) k in D(b)

output_cost(b1) = poutput_cost(b2) =2poutput_cost(b6) =2poutput_cost(b3) =3poutput_cost(b4) =3poutput_cost(b5)= 4p

What if selectivity of b6 is 10%?output_cost(b6) = cost(b6)/(sel(b6)*sel(b1)) + cost(b1)/sel(b1) = p/0.1+p/1 = 11p

 - 10/16/ - Data Streams: Lecture 
  • MC Traversal Example b4 b5 b - b - b
    • b - b - b - b - b - b - b - 10/16/ - Data Streams: Lecture
  • ML Traversal Example b4 b5 b - b - b
    • b - b - b - b - b - b - b - b - b - b - b - b3b - 10/16/ - Data Streams: Lecture
  • ML Traversal Example b4 b5 b - b - b
    • b - b output_cost(b1) = poutput_cost(b2) = 2poutput_cost(b3) = 3poutput_cost(b4) = 3poutput_cost(b5)=4poutput_cost(b6) = 11p - b - b1 b2 b - b - b - b - b3b - b - b