[IEEE 22nd International Conference on Data Engineering (ICDE'06) - Atlanta, GA, USA (2006.04.3-2006.04.7)] 22nd International Conference on Data Engineering (ICDE'06) - Approximating StreamingWindow Joins Under CPU Limitations

Download [IEEE 22nd International Conference on Data Engineering (ICDE'06) - Atlanta, GA, USA (2006.04.3-2006.04.7)] 22nd International Conference on Data Engineering (ICDE'06) - Approximating StreamingWindow Joins Under CPU Limitations

Post on 25-Mar-2017

216 views

Category:

Documents

4 download

Embed Size (px)

TRANSCRIPT

<ul><li><p>Approximating Streaming Window Joins Under CPU Limitations</p><p>Ahmed Ayad Jeffrey Naughton Stephen WrightComputer Sciences Department</p><p>University of Wisconsin Madison{ahmed, naughton, swright}@cs.wisc.edu</p><p>Utkarsh SrivastavaDepartment of Computer Science</p><p>Stanford Universityusriv@db.stanford.edu</p><p>Abstract</p><p>Data streaming systems face the possibility of having toshed load in the case of CPU or memory resource limita-tions. We study the CPU limited scenario in detail. First, wepropose a new model for the CPU cost. Then we formallystate the problem of shedding load for the goal of obtain-ing the maximum possible subset of the complete answer,and propose an online strategy for semantic load shedding.Moving on to random load shedding, we discuss randomload shedding strategies that decouple the window main-tenance and tuple production operations of the symmetrichash join, and prove that one of them Probe-No-Insert always dominates the previously proposed coin flippingstrategy.</p><p>1. Introduction</p><p>In the context of data streaming systems, the system hasno control over the rate of the incoming data. Hence, theadoption of a push model of computation is mandatory. Insteady state, the system resources must be greater than whatis required by the input, or the system is unstable and thequery is infeasible [2]. The system CPU has to keep up withthe arrival rate to avoid the input queues and response timegrowing indefinitely. Also, the amount of available memoryhas to be enough to hold the required state of the query plustuples arriving in the input queues of the data streams thatawait processing.</p><p>If the system resources are less than the input require-ments, some of the input must be shed to bring the loaddown to within the available capacity. Previous work hasaddressed the case of memory-limited execution [5][7].Specifically, it looked at the case when the system can nothold the complete state of the operators (e.g., the tuplesthat satisfy the window predicate in a sliding window join).Such work, however, does not address the case when in-put queues are overflowing, which is a result of high CPUutilization. This means CPU limitation can be a cause of</p><p>memory limitations, even if enough memory is available tostore the state of the operators. Hence our focus on CPU-limited execution.</p><p>We investigate the problem of load shedding for thestreaming window join operator under CPU limitations indetail. We start by revising the unit time model for the CPUcost of executing the join. We study semantic and randomload shedding for the Max-Subset goal [5]. In particular,our contributions are:</p><p> We present an accurate unit-time model for the CPUcost of executing a streaming window join.</p><p> For the Max-Subset load shedding goal, we formulatethe theoretical problem for shedding load under CPUlimitations in an offline scenario. We prove that, unlikethe case for memory limited execution [5], the problemis NP-Hard.</p><p> We develop an online strategy for semantic load shed-ding for the same goal.</p><p> We study a different set of strategies for random loadshedding for the Max-Subset goal that decouples thedecision of inserting and probing tuples.</p><p> We prove that one such strategy, the Probe-No-Insert,outperforms previously suggested methods for randomload shedding. In doing so, we show that having suffi-cient memory to store the whole state of the join doesnot help.</p><p>2. Cost Model</p><p>For the purpose of this work, we are concerned with thesliding window streaming join operator. Concrete defini-tions of data streams, sliding windows, and the sliding win-dow streaming join are given in [1]. We will refer to thedata structure that holds the tuples that satisfy the slidingwindow predicate on a stream as the window synopsis [3].</p><p>There are basically four operations performed for everyincoming tuple. The four operations can be categorized into</p><p>Proceedings of the 22nd International Conference on Data Engineering (ICDE06) 8-7695-2570-9/06 $20.00 2006 IEEE </p></li><li><p>update operations; which include insertion and expiration,and production related operations; which include probingand producing the results. The cost of update operations isproportional to the tuple arrival rate (in steady state, everytuple inserted in the window synopsis has to expire), and thecost of production operations is proportional to the outputrate of the join. Let Cu be the cost of inserting and expiringa tuple from the window synopsis, Cp be the cost of probingand producing one result tuple, and o/p be the output rate.The cost of the join can then be expressed as</p><p>CLR = (L + R) Cu + o/p Cp (1)By assigning the cost of probing and production to outputtuples instead of input tuples, the model takes into accountthe variable cost of probing between different input tuples.</p><p>2.1. Goals of Load Shedding</p><p>Streaming applications differ in their requirements whenfaced with the inability to produce the full answer. Differentapplications require different characteristics in the approxi-mate answer produced by the load shedding scheme. In thiswork, we focus on the Max-Subset goal, in which it is re-quired to produce a subset of the join of the maximum sizeallowed by the systems computational resources. We alsolook at an orthogonal dimension which is the availability ofstatistical information on the data distributions of the input.If any such information is available, semantic load shed-ding, in which the strategy intelligently picks tuples to dis-card based on their values, is possible. Otherwise, randomload shedding is the only option. In Section 3, we discussthe load shedding problem under CPU-limited constraintsfor the Max-subset problem.</p><p>3. The Max-subset Goal</p><p>We investigate the problem for the goal of obtaining themaximum possible subset of the answer given the CPU bud-get. The problem is formally defined in [5].</p><p>3.1. Semantic Load Shedding</p><p>Using the model developed in Section 2, we investigatethe optimum load shedding strategy. Since the join queryis continuous, the sizes of the input streams are infinite.Hence, modeling of the complete result of join is infeasi-ble. Instead, we model only a prefix of the join result thatextends until a specific time in the future. Consider the joinL[T1] R[T2]. Assuming we are looking T time units intothe future, the total CPU cost budget available for the joinoperatorK is T C where C is the unit time capacity of theCPU. According to equation 1, there is a cost Cu for main-taining each tuple in the input and a cost Cp for producing</p><p>an output tuple. We can represent the join result as a bipar-tite graph in which the set of nodes on the right (left) handside represents tuples of L (R) and an edge joining two in-put tuples represents the tuple resulting from their join, withCu attached to the nodes and Cp to the edges. The optimumalgorithm should select a subset of the output tuples suchthat the cost of their production is less than K while maxi-mizing the number of selected edges. In the full version ofthis note [1], we concretely define the problem and analyzetwo variants of an off-line algorithm called the Offline Max-Subset and the Offline Induced Max-Subset algorithms forsolving the problem.</p><p>The following theorem gives the complexity of these twovariants [1]:</p><p>Theorem 1. Both Offline Max-Subset and Offline InducedMax Subset are NP-Hard.</p><p>We can try to approximate the procedure of finding theoptimum answer for both variants by a deterministic al-gorithm that selects edges for inclusion in the answer ac-cording to a specific criterion. We propose in [1] two suchcriteria and methods to quantify them. We also propose agreedy algorithm to approximate the optimum for the off-line case. We use the algorithm as a basis for an onlinesemantic load shedding strategy for the CPU-limited execu-tion of the streaming join.</p><p>3.2. Random Load Shedding</p><p>We now examine the case in which the details of the dis-tribution of the input are unknown. We only assume theinput follows the frequency model [7].</p><p>The approach previously taken for random load sheddingwas to find the best setting of random sampling operatorsapplied to the input stream so that the maximum subset isobtained while keeping the load within CPU limits. Weshall call this the coin flipping strategy (or CF) [4]. Ourcontribution is to investigate whether more can be gainedby decoupling the update and the production procedures ofan incoming tuple in the shedding process. Recall that toexecute the join, every incoming tuple has to be insertedin the window of its stream for later matching and it hasto probe the window of the opposite stream for matchingwith tuples that arrived earlier to produce results. The coinflipping approach couples these two procedures by insistingthat either the whole contribution of the tuple to the join betaken completely or none is. This is not necessary, since thetwo procedures are independent. Realizing this, two otherapproaches arise; namely the Insert-No-Probe (or INP) andthe Probe-No-Insert (or PNI) strategies.</p><p>Consider the join L[T1] R[T2] with L and R as therates of the input streams, with join selectivity f . If the join</p><p>Proceedings of the 22nd International Conference on Data Engineering (ICDE06) 8-7695-2570-9/06 $20.00 2006 IEEE </p></li><li><p>is feasible, the output rate is [2]:</p><p>o/p = f L R (TL + TR) (2)</p><p>In the following we describe each shedding strategy insome detail.</p><p>Coin Flipping (CF)In the CF strategy a sampling operator is placed in</p><p>front of each the two streams, with xL and xR beingthe sampling probability of the one on stream L and Rrespectively. The coin flipping strategy can be formalizedas the following optimization problem [2]:</p><p>Max:</p><p>o/p = f L R (TL + TR) xL xR (3)</p><p>Subject to:</p><p>(L xL + R xR) Cu + o/p Cp 10 xL, xR 1 (4)</p><p>Insert-No-Probe (INP)In the INP strategy, instead of dropping some of the tu-</p><p>ples completely, all incoming tuples are admitted into thewindow. Then a coin is flipped with probability of probingxL and xR for L and R respectively. If the flip is a success,the tuple probes the opposite window, otherwise the tuple isdropped. The strategy calls for the best setting of xL andxR while maximizing the output rate. It can be formalizedas the following optimization problem:Max:</p><p>o/p = f L R (TL xR + TR xL) (5)</p><p>Subject to:</p><p>(L + R) Cu + o/p Cp 10 xL, xR 1 (6)</p><p>The intuition behind this strategy is that since we arenot constrained in terms of memory, why not keep all thestate we can in the hope that the extra kept state producesmore tuples. This strategy appears at first sight to be thecandidate for delivering the maximum possible subset,since it capitalizes on the asset which is not constrained; inthis case memory.</p><p>Probe-No-Insert (PNI)The PNI strategy is the inverse of the previous one. All</p><p>incoming tuples are allowed to probe the opposite window,and then a coin is flipped on inserting them in the windowsynopsis for later matching. It can be formalized as follows:</p><p>Max:</p><p>o/p = f L R (TL xL + TR xR) (7)Subject to:</p><p>(L xL + R xR) Cu + o/p Cp 10 xL, xR 1 (8)</p><p>Analyzing the three alternatives, we found the PNI strat-egy to be the superior alternative and the INP the inferiorone. The extended version of this note [1] contains the de-tails of the analysis. To understand the intuition behind thisresult, note that the cost of outputting a single tuple of thejoin result is divided into production cost, which cannot bereduced, and an amortized cost of maintaining the input tu-ples in the window. In the INP strategy, the tuples that donot probe the opposite window actually pays the price ofmaintenance while missing on producing tuples, hence theamortized cost of maintenance is high compared to the otherstrategies. The PNI strategy allows tuples already insertedin the window to be probed by all the possible tuples theylater matche with, hence amortizing their update cost that isalready incurred to the maximum possible. The CF strategymisses on some of that by dropping some of the incomingtuples.</p><p>Acknowledgements</p><p>This research was supported in part by NSF grant ITR0086002.</p><p>Ahmed Ayad is thankful to Raghav Kaushik for fruitfuldiscussions and suggestions.</p><p>References</p><p>[1] A. Ayad, J. Naughton, S. Wright, and U. Srivastava. Approx-imating streaming window joins under cpu limitations. Tech-nical report, Department of Computer Sciences, University ofWisconsin - Madison, 2005.</p><p>[2] A. Ayad and J. F. Naughton. Static optimization of conjunc-tive queries with sliding windows over infinite streams. InSIGMOD Conference, pages 419430, 2004.</p><p>[3] B. Babcock, S. Babu, M. Datar, R. Motwani, and J. Widom.Models and issues in data stream systems. In PODS, pages116, 2002.</p><p>[4] S. Chaudhuri, R. Motwani, and V. R. Narasayya. On randomsampling over joins. In SIGMOD Conference, pages 263274, 1999.</p><p>[5] A. Das, J. Gehrke, and M. Riedewald. Approximate join pro-cessing over data streams. In SIGMOD Conference, pages4051, 2003.</p><p>[6] J. Kang, J. F. Naughton, and S. Viglas. Evaluating windowjoins over unbounded streams. In ICDE, pages 341352,2003.</p><p>[7] U. Srivastava and J. Widom. Memory-limited execution ofwindowed stream joins. In VLDB, pages 324335, 2004.</p><p>Proceedings of the 22nd International Conference on Data Engineering (ICDE06) 8-7695-2570-9/06 $20.00 2006 IEEE </p><p> /ColorImageDict &gt; /JPEG2000ColorACSImageDict &gt; /JPEG2000ColorImageDict &gt; /AntiAliasGrayImages false /CropGrayImages true /GrayImageMinResolution 150 /GrayImageMinResolutionPolicy /OK /DownsampleGrayImages true /GrayImageDownsampleType /Bicubic /GrayImageResolution 300 /GrayImageDepth -1 /GrayImageMinDownsampleDepth 2 /GrayImageDownsampleThreshold 2.00333 /EncodeGrayImages true /GrayImageFilter /DCTEncode /AutoFilterGrayImages false /GrayImageAutoFilterStrategy /JPEG /GrayACSImageDict &gt; /GrayImageDict &gt; /JPEG2000GrayACSImageDict &gt; /JPEG2000GrayImageDict &gt; /AntiAliasMonoImages false /CropMonoImages true /MonoImageMinResolution 1200 /MonoImageMinResolutionPolicy /OK /DownsampleMonoImages true /MonoImageDownsampleType /Bicubic /MonoImageResolution 600 /MonoImageDepth -1 /MonoImageDownsampleThreshold 1.00167 /EncodeMonoImages true /MonoImageFilter /CCITTFaxEncode /MonoImageDict &gt; /AllowPSXObjects false /CheckCompliance [ /None ] /PDFX1aCheck false /PDFX3Check false /PDFXCompliantPDFOnly false /PDFXNoTrimBoxError true /PDFXTrimBoxToMediaBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXSetBleedBoxToMediaBox true /PDFXBleedBoxToTrimBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXOutputIntentProfile (None) /PDFXOutputConditionIdentifier () /PDFXOutputCondition () /PDFXRegistryName (http://www.color.org) /PDFXTrapped /False</p><p> /Description &gt;&gt;&gt; setdistillerparams&gt; setpagedevice</p></li></ul>

Recommended

View more >