Load Shedding in a Data Stream Manager Slides

  • Slides: 43
Download presentation
Load Shedding in a Data Stream Manager Slides edited from the original slides of

Load Shedding in a Data Stream Manager Slides edited from the original slides of Kevin Hoeschele Anurag Shakti Maskey 1

Overview • Loadshedding in Streams example • How Aurora looks at Load Shedding •

Overview • Loadshedding in Streams example • How Aurora looks at Load Shedding • The algorithms Used by Aurora • Experiments and results 2

Load Shedding in a DSMS • Systems have a limit to how much fast

Load Shedding in a DSMS • Systems have a limit to how much fast data can be processed • When the rate is too high, Queues will build up waiting for system resources • Loadshedding discards some data so the system can flow • Different from networking loadshedding – Data has semantic value in DSMS – Qo. S can be used to find the best stream to drop 3

 • Hospital - Network – Stream of free doctors locations – Stream of

• Hospital - Network – Stream of free doctors locations – Stream of untreated patients locations, their condition (dieing, critical, injured, barely injured) – Output: match a patient with doctors within a certain distance Patients Join Doctors who can work on a patient Doctors 4

Too many Patients, what to do? • Loadshedding based on condition – Official name

Too many Patients, what to do? • Loadshedding based on condition – Official name “Triage” – Most critical patients get treated first – Filter added before the Join • Selectivity based on amount of untreated patients Patients Condition Filter Join Doctors who can work on a patient Doctors 5

Aurora Overview • Push based data from streaming sources • 3 kinds of Quality

Aurora Overview • Push based data from streaming sources • 3 kinds of Quality of Service – Latency • Shows utility drop as answers take longer to achieve – Value-based • Shows which output values are most important – Loss-tolerance • Shows how approximate answers affect a query 6

Loadshedding Techniques • Filters (semantic drop) – Chooses what to shed based on Qo.

Loadshedding Techniques • Filters (semantic drop) – Chooses what to shed based on Qo. S – Filter with a predicate in which selectivity = 1 -p – Lowest utility tuples are dropped • Drops (random drop) – Eliminates a random fraction of input – Has a p% chance of dropping each incoming tuple 7

3 Questions of Load Shedding • When – Load of system needs constant evaluation

3 Questions of Load Shedding • When – Load of system needs constant evaluation • Where – Dropping as early as possible saves most resources • Can be a problem with streams that fan out and are used by multiple queries • How much – the percent for a random drop – Make the predicate for a semantic drop (filter) 8

Load Shedding in Aurora • Aurora Catalog – Holds Qo. S and other statistics

Load Shedding in Aurora • Aurora Catalog – Holds Qo. S and other statistics – Network description • Loadshedder monitors these and input rates: makes loadshedding decisions – Inserts drops/filters into the query network, which are stored in the catalog Load Shedder Data rates Changes to Query plans Network description Catalog Input streams Query Network output 9

Equation • • • N= network I=input streams C=processing capacity Uaccuracy= utility from loss-tolerance

Equation • • • N= network I=input streams C=processing capacity Uaccuracy= utility from loss-tolerance Qo. S graph H=Headroom factor, % of sys resources that can be used at a steady state If (Load(N(I)) > C then load shedding is needed (why no H) Goal is to get a new network N’ based on N but where: min{Uaccuracy(N(I))-Uaccuracy(N’(I))} and (Load(N’(I)) < H * C 10

Load Shedding Algorithm • Evaluation Step – When to shed load? • Load Shedding

Load Shedding Algorithm • Evaluation Step – When to shed load? • Load Shedding Road Map (LSRM) – Where to shed load? – How much load to shed? 11

Load Evaluation • Load Coefficients (L) [processor cycles / tuple] – the number of

Load Evaluation • Load Coefficients (L) [processor cycles / tuple] – the number of processor cycles required to push a single tuple through the network to the outputs • n operators • ci = cost • si = selectivity I L = c 1 c 2 s 1 s 2 … cn sn O 12

Load Evaluation Load Coefficient L 2 = 14 2 L 3 = 5 3

Load Evaluation Load Coefficient L 2 = 14 2 L 3 = 5 3 c 2 = 10 cn = 5 s 2 = 0. 8 sn = 1. 0 O 1 L 1 = 22 1 c 1 = 10 I L(I) = 22 s 1 = 0. 5 L 4 = 10 4 c 2 = 10 s 2 = 0. 9 O 2 L 1 = 10 + (0. 5 * 10) + (0. 5 * 0. 8 * 5) + (0. 5 * 10) = 22 L 2 = 10 + (0. 8 * 5) = 14 13

Load Evaluation • Stream Load (S) – load created by the current stream rates

Load Evaluation • Stream Load (S) – load created by the current stream rates • m input streams • Li = load coefficient • ri = input rate S = 14

Load Evaluation Stream Load L 2 = 14 2 L 3 = 5 3

Load Evaluation Stream Load L 2 = 14 2 L 3 = 5 3 c 2 = 10 cn = 5 s 2 = 0. 8 sn = 1. 0 O 1 L 1 = 22 1 I L(I) = 22 r = 10 c 1 = 10 s 1 = 0. 5 L 4 = 10 4 c 2 = 10 s 2 = 0. 9 O 2 S = 22 * 10 = 220 15

Load Evaluation • Queue Load (Q) – load due to any queues that may

Load Evaluation • Queue Load (Q) – load due to any queues that may have built up since the last load evaluation step • MELT_RATE = how fast to shrink the queues (queue length reduction per unit time) • Li = load coefficient • qi = queue length Q = MELT_RATE * Li * qi 16

Load Evaluation Queue Load L 2 = 14 2 q = 100 L 3

Load Evaluation Queue Load L 2 = 14 2 q = 100 L 3 = 5 3 c 2 = 10 cn = 5 s 2 = 0. 8 sn = 1. 0 O 1 L 1 = 22 1 I L(I) = 22 r = 10 c 1 = 10 s 1 = 0. 5 L 4 = 10 4 c 2 = 10 s 2 = 0. 9 O 2 MELT_RATE = 0. 1 Q = 0. 1 * 5 * 100 = 50 17

Load Evaluation Total Load • Total Load (T) = S + Q L 2

Load Evaluation Total Load • Total Load (T) = S + Q L 2 = 14 2 q = 100 L 3 = 5 3 c 2 = 10 cn = 5 s 2 = 0. 8 sn = 1. 0 O 1 L 1 = 22 1 I L(I) = 22 r = 10 c 1 = 10 s 1 = 0. 5 L 4 = 10 4 c 2 = 10 s 2 = 0. 9 T = 220 + 50 = 270 O 2 18

Load Evaluation • The system is overloaded when T > H * C headroom

Load Evaluation • The system is overloaded when T > H * C headroom factor processing capacity 19

Load Shedding Algorithm • Evaluation Step – When to drop? • Load Shedding Road

Load Shedding Algorithm • Evaluation Step – When to drop? • Load Shedding Road Map (LSRM) – How much to drop? – Where to drop? 20

Load Shedding Road Map (LSRM) how many cycles will be saved <Cycle Savings Coefficients

Load Shedding Road Map (LSRM) how many cycles will be saved <Cycle Savings Coefficients (CSC) Drop Insertion Plan (DIP) set of drops that will be inserted Percent Delivery Cursors (PDC)> where the system will be running when the DIP is adopted ENTRY 1 … … … CSC DIP PDC less load shedding ENTRY n max savings … (0, 0, 0, …, 0) cursor more load shedding 21

LSRM Construction set Drop Locations compute & sort Loss/Gain ratios Drop-Based LS Filter-Based (Semantic)

LSRM Construction set Drop Locations compute & sort Loss/Gain ratios Drop-Based LS Filter-Based (Semantic) LS take the least ratio how much to drop? insert Drop determine predicate create LSRM entry insert Filter create LSRM entry 22

Drop Locations set Drop Locations Single Query compute & sort Loss/Gain ratios Drop-Based LS

Drop Locations set Drop Locations Single Query compute & sort Loss/Gain ratios Drop-Based LS L 1 = 17 L 2 = 14 2 1 I A c 1 = 10 s 1 = 0. 5 B c 2 = 10 s 2 = 0. 8 Filter-Based LS L 3 = 5 3 C cn = 5 sn = 1. 0 D O 23

Drop Locations Single Query set Drop Locations compute & sort Loss/Gain ratios Drop-Based LS

Drop Locations Single Query set Drop Locations compute & sort Loss/Gain ratios Drop-Based LS L 1 = 17 I A Filter-Based LS 1 L 2 = 14 2 L 3 = 5 3 c 1 = 10 c 2 = 10 cn = 5 s 1 = 0. 5 s 2 = 0. 8 sn = 1. 0 O 24

Drop Locations set Drop Locations Shared Query compute & sort Loss/Gain ratios Drop-Based LS

Drop Locations set Drop Locations Shared Query compute & sort Loss/Gain ratios Drop-Based LS L 2 = 14 2 c 2 = 10 L 1 = 22 1 I A c 1 = 10 s 1 = 0. 5 B L 3 = 5 3 D s 2 = 0. 8 C Filter-Based LS E cn = 5 sn = 1. 0 O 1 L 4 = 10 4 c 2 = 10 s 2 = 0. 9 F O 2 25

Drop Locations set Drop Locations Shared Query compute & sort Loss/Gain ratios Drop-Based LS

Drop Locations set Drop Locations Shared Query compute & sort Loss/Gain ratios Drop-Based LS L 1 = 22 1 I A c 1 = 10 s 1 = 0. 5 B L 2 = 14 2 L 3 = 5 3 c 2 = 10 cn = 5 s 2 = 0. 8 sn = 1. 0 C Filter-Based LS O 1 L 4 = 10 4 c 2 = 10 s 2 = 0. 9 O 2 26

Loss/Gain Ratio set Drop Locations Loss compute & sort Loss/Gain ratios Drop-Based LS Filter-Based

Loss/Gain Ratio set Drop Locations Loss compute & sort Loss/Gain ratios Drop-Based LS Filter-Based LS • Loss – utility loss as tuples are dropped – determined using loss-tolerance Qo. S graph utility Loss for first piece of graph 1 0. 7 0 100 = (1 – 0. 7) / 50 50 0 % tuples = 0. 006 27

Loss/Gain Ratio Gain set Drop Locations compute & sort Loss/Gain ratios Drop-Based LS Filter-Based

Loss/Gain Ratio Gain set Drop Locations compute & sort Loss/Gain ratios Drop-Based LS Filter-Based LS • Gain – processor cycles gained Gain G(x) = • R = input rate into drop operator • L = load coefficient • x = drop percentage • D = cost of drop operator • STEP_SIZE = increments for x to find G(x) (To garanty G(x) > 0) 28

Drop-Based Load Shedding how much to drop? Drop-Based LS take the least ratio how

Drop-Based Load Shedding how much to drop? Drop-Based LS take the least ratio how much to drop? insert Drop create LSRM entry • Take the least Loss/Gain ratio • Determine the drop percentage p 29

Drop-Based Load Shedding Drop-Based LS take the least ratio how much to drop? where

Drop-Based Load Shedding Drop-Based LS take the least ratio how much to drop? where to drop? insert Drop create LSRM entry L 1 = 17 L 2 = 14 2 1 I drop A c 1 = 10 s 1 = 0. 5 drop c 2 = 10 L 3 = 5 3 drop s 2 = 0. 8 If there are other drops in the network, modify their drop percentages. cn = 5 drop O sn = 1. 0 30

Drop-Based Load Shedding make LSRM entry Drop-Based LS take the least ratio how much

Drop-Based Load Shedding make LSRM entry Drop-Based LS take the least ratio how much to drop? insert Drop • All drop operators with the modified create LSRM entry percentages form the DIP • Compute CSC • Advance Qo. S cursors and store in PDC LSRM Entry <Cycle Savings Coefficients (CSC) Drop Insertion Plan (DIP) Percent Delivery Cursors (PDC)> 31

Filter-Based (Semantic) Load Shedding how much to drop? predicate for filter Filter-Based LS take

Filter-Based (Semantic) Load Shedding how much to drop? predicate for filter Filter-Based LS take the least ratio how much to drop? determine predicate • Start dropping from the interval create LSRM entry with the lowest utility. • Keep a sorted list of intervals according to their utility and relative frequency. • Find out how much to drop and what intervals are needed to. • Determine the predicate for filter. 32 insert Filter

Filter-Based Load Shedding Filter-Based LS take the least ratio place the filter how much

Filter-Based Load Shedding Filter-Based LS take the least ratio place the filter how much to drop? determine predicate insert Filter create LSRM entry L 1 = 17 L 2 = 14 2 1 I filter A c 1 = 10 s 1 = 0. 5 filter c 2 = 10 L 3 = 5 3 filter s 2 = 0. 8 If there are other filters in the network, modify their selectivities. cn = 5 filter O sn = 1. 0 33

Experiment setup • Simulated network – Processing tuple time simulated by having the simulator

Experiment setup • Simulated network – Processing tuple time simulated by having the simulator process use the cpu for amount of time needed for an operator to consume a tuple – Process for each input stream – randomly created network • Num querys, Num operations for querys chosen • Random networks a good benchmark? 34

Experiments • Used only Join, Filter, Union Aurora Operators – Filters were simple comparison

Experiments • Used only Join, Filter, Union Aurora Operators – Filters were simple comparison predicates of the form: • Input_value > filter_constant • Filters and Drops loadshedding were Compared to 4 Admission Control Algorithms – Similar in style to networking loadshedding 35

Evaluation Methods • Loss-tolerance, and Value-based Qo. S were used • Tuple Utility is

Evaluation Methods • Loss-tolerance, and Value-based Qo. S were used • Tuple Utility is the utility from Loss-tolerance Qo. S – K= num time segments – ni= num tuples per time segment i – ui= loss-tolerance utility for each tuple during time segment i 36

Value Utility • Value Utility is the Utility from value-based Qo. S – fi=

Value Utility • Value Utility is the Utility from value-based Qo. S – fi= relative frequency of tuples in value interval i with no drops – fi’=frequency relative to the total number of tuples – Ui=average value utility for value interval i • When there are multiple queries, Overall Utility is the sum of the utilities for each query 37

Algorithms • Input-Random – One random stream is chosen, and tuples are shed untill

Algorithms • Input-Random – One random stream is chosen, and tuples are shed untill excess load is covered – if the whole stream is shed and there is still excess load, another random stream is chosen • Input-Cost-Top – Similar to Input-Random, but uses the input stream with the most costly input • Input-Uniform – Distributes load shedding uniformly by each input stream • Input-Cost-Uniform – Load is shed of all input streams, weighted by their 38

Results – Tuple Utility Loss Observations: Qo. S driven Algorithms Perform better Filter works

Results – Tuple Utility Loss Observations: Qo. S driven Algorithms Perform better Filter works better then Drop 39

Results -Value utility loss Filter-LS is clearly the best Drop-LS is no better then

Results -Value utility loss Filter-LS is clearly the best Drop-LS is no better then the Admission control algorithms 40

Conclusion • Loadshedding is important to DSMS • Many variables to considor when planning

Conclusion • Loadshedding is important to DSMS • Many variables to considor when planning to use Loadshedding • Drop and Filter are two Qo. S driven algorithms • Qo. S based strategies work better then Admission control 41

Questions • Drop and Filter were the two Qo. S loadshedding algorithms given here.

Questions • Drop and Filter were the two Qo. S loadshedding algorithms given here. Are there any others? • Admission Control may be a viable option in processing network requests, but in a streaming database system the connection is already made. Where putting the incoming tuples into a buffer to in effect deny the stream bandwidth, would this increase utility? • Why are REDs useful or not useful for streaming databases? 42

More Questions • When we have a low bandwidth connection like a sensor that

More Questions • When we have a low bandwidth connection like a sensor that is unreliable and when a significant amount of traffic is out of order, is TCP the best transport protocol? • When there is high traffic, to what extent should the network do the load shedding? Should the database system be doing more because it knows the semantics of the tuples? • So the idea of Admission control doesn't directly crossover from networks to streaming databases. But does the idea of buffering the input when the process becomes overloaded, achieve the same effect? Why 43