• No results found

Filtering of Example Subscription Classes

5.7 Correlation to Filter Efficiency

5.7.2 Filtering of Example Subscription Classes

Figure 5.5 shows the filter efficiency (ordinate) of both algorithms (“Bool” and “Conj” in the figure) with an increasing number of registered subscriptions |s| on the abscissa. For each algorithm, we evaluated five distributions in the operands of subscriptions. As can be seen in the figure, the time efficiency of both algorithms is only slightly influenced by the actual predicate distributions. Theoretically, both algorithms should show linearly increasing filter times (ordinate) with increasing subscription numbers (abscissa). In practice, how- ever, both approaches appear to lead to super-linearly developing filter times, as illustrated in Figure 5.5. The reason for this property of both algorithms is found in their general approach of incrementing counters per subscription and the influence of a limited processor cache. The behavior of the filter efficiency, in fact, is linear but advantageously influenced by the processor cache for small subscription numbers, leading to a smaller initial gradient.

The point of changing gradients occurs at a much smaller number of sub- scriptions for the counting algorithm than for the general Boolean algorithm because the conjunctive algorithm needs to internally convert the original sub- scriptions. Thus, for the counting algorithm, more counters in more subscrip- tions need to be increased after the conversion (i.e., the hit vector contains more entries). Hence the hit vector does not fit into the processor cache from approximately 50,000 original subscriptions onwards (leading to 200,000 con- verted ones). After having registered approximately 100,000 original subscrip- tions (400,000 converted ones), the influence of the processor cache is negligible and thus the maximal gradients of the curves are reached.

0 50 100 150 200 250 300 500,000 400,000 300,000 200,000 100,000

Average time per event in ms

Number of original subscriptions |s|

Bool (u) Bool (z) Bool (n) Bool (rz) Bool (rn) Conj (u) Conj (z) Conj (n) Conj (rz) Conj (rn)

Figure 5.5: Filter efficiency of the Boolean algorithm (“Bool”) and the con- junctive counting algorithm (“Conj”) in the combined setting using various distributions in predicates (u–uniform, n–normal, z–Zipf, rn–reversed normal, rz–reversed Zipf distribution).

the effect on this algorithm is much less:

Firstly, the point of changing gradients occurs at a much larger number of registered subscriptions: |s| ≈ 200, 000 on the abscissa. Interestingly, this number of subscriptions is four times the number of subscriptions in the con- junctive setting. The reason for this behavior is clearly that conversion leads to four times the number of original subscriptions. Hence the processor cache can store four times more unconverted subscriptions in the hit vector.

Secondly, the main proportion of filter time is not spent on increasing coun- ters but on evaluating candidate subscriptions (there are far fewer predicates because no canonical conversion needs to be performed). Hence the processor cache only has a minor influence on overall filter efficiency, that is, the change in the gradient is less than in the conjunctive algorithm.

Interpreting the curves in Figure 5.5, both algorithms initially show similar filter times. The more subscriptions get registered, the larger the difference between general Boolean approach and conjunctive approach. Having regis- tered more than 400,000 subscriptions, the difference between the algorithms stabilizes: per event message, the Boolean solution requires approximately 75, 64, 68, 72, and 76 milliseconds less than the conjunctive approach for the five tested distributions. For 500,000 subscriptions, this is an improvement of approximately 27 percent for the analyzed predicate distributions.

Although the presented results depend on the processor cache, they can be generalized to universal settings: Changes in the cache size only shift the

0 20 40 60 80 100 120 140 160 180 500,000 400,000 300,000 200,000 100,000

Average time per event in ms

Number of original subscriptions |s|

Bool (u) Conj (u)

Figure 5.6: Filter efficiency for Subscription Class 1 using uniform distribu- tions in predicates. 0 50 100 150 200 250 300 350 400 450 500 500,000 400,000 300,000 200,000 100,000

Average time per event in ms

Number of original subscriptions |s|

Bool (u) Conj (u)

Figure 5.7: Filter efficiency for Subscription Class 2 using uniform distribu- tions in predicates.

point of changing gradients (on the abscissa) for both filtering approaches. The occurrence of this point for the conjunctive algorithm always happens at a far smaller number of subscriptions due to the need to perform canonical conversion for such an approach. For large subscription numbers, the influence of the processor cache on filter time is negligible, as can be seen in the increased but stable gradients of the curves. Here the general Boolean filtering approach is more time-efficient than the conjunctive approach, as shown in Figure 5.5. Separate Settings: Individual Subscription Classes

The time efficiency of both counting algorithm and general Boolean algorithm depends on the registered subscriptions. Having evaluated the combined set- ting in the previous paragraph, we now investigate the filter efficiency for the

0 10 20 30 40 50 60 500,000 400,000 300,000 200,000 100,000

Average time per event in ms

Number of original subscriptions |s|

Bool (u) Conj (u)

Figure 5.8: Filter efficiency for Subscription Class 3 using uniform distribu- tions in predicates.

individual subscription classes.

Figures 5.6 to 5.8 give an overview of the time efficiency properties of both algorithms. For all subscription classes, one can identify the points of changing gradients. The difference in these points broadly aligns with the influence of canonical conversion that is required for the counting approach: two, four, and six conjunctive subscriptions are created due to conversion. Hence, in the Boolean setting, the point of changing gradients occurs at a number of registered subscriptions that is approximately two, four, and six times higher than in the conjunctive setting.

Subscription Class 1 (Figure 5.6) and Class 3 (Figure 5.8) always show sim- ilar or advantageous efficiency properties in the general Boolean approach. In particular for Subscription Class 3, the difference between the two algorithm classes (Boolean and conjunctive) constantly increases for a growing subscrip- tion base: for 500,000 registered subscriptions, the general Boolean approach is approximately 61 percent more time-efficient than the conjunctive approach. For Subscription Class 1, the time difference between the approaches re- mains nearly constant from approximately 300,000 subscriptions onwards (the Boolean solution shows a slightly smaller gradient). For subscriptions of this class, the general Boolean approach is approximately 27 percent more efficient than the conjunctive approach for 500,000 registered subscriptions.

For Subscription Class 2 (Figure 5.7) up to approximately 80,000 subscrip- tions, the counting approach is slightly more efficient than its general Boolean extension. However, this behavior changes for higher subscription numbers, where the Boolean algorithm becomes the more efficient solution. The final

gradients of both algorithm are nearly on par with each other (the conjunctive solution shows a slightly smaller final gradient4). For 500,000 registered sub-

scriptions, the general Boolean filtering solution is approximately 20 percent more efficient than the conjunctive approach.

Theoretically, the difference between conjunctive and Boolean algorithm should increase with an increasing number of subscriptions created due to conversion (i.e., with Subscription Class 1, 2, and 3). Subscription Class 2, however, does not follow this trend. The reason is that for this class of sub- scriptions the general Boolean filtering algorithm leads to a large number of candidate subscriptions to evaluate. Despite this effect, the Boolean algorithm still leads to a higher filter efficiency than its conjunctive counterpart.

The differing behavior of filter efficiency for subscriptions of the individ- ual classes leads to the results in the combined setting. Here, the Boolean algorithm is approximately 27 percent more efficient than the conjunctive al- gorithms, as presented in the previous paragraph.

5.8

Summary

In this chapter, we presented a comparative evaluation of the general-purpose conjunctive counting algorithm and our general-purpose Boolean filtering al- gorithm. This analysis focused on the two quality measures system efficiency and scalability that were identified in Section 2.2. We introduced a charac- terization framework to describe the typical patterns of subscriptions. Based on this framework, we then described the memory use of two conjunctive al- gorithms and our general Boolean algorithm. We found that for our example subscription classes a general Boolean algorithm requires less memory than conjunctive approaches. Our solution is thus the favorable choice with respect to scalability for an online auction scenario.

Generally we could show that there are various settings in which the oc- currence of only one disjunction in subscriptions favors a Boolean filtering so- lution. Thus, general Boolean filtering algorithms are the more memory-aware and therefore the more scalable choice for the central filtering components if subscriptions are not purely conjunctive. Our characterization framework allows us to choose the preferable algorithm class for any subscriptions.

4However, the conjunctive solution does not scale to the number of subscriptions that the Boolean solution does (see Section 5.5.3).

Regarding the comparison of time efficiency, we analyzed the behavior in the online book auction example scenario. We evaluated several predicate distributions in subscriptions and found that the general Boolean filtering al- gorithm is also favorable over a general-purpose conjunctive algorithm with respect to filter efficiency for large subscription numbers. We can thus state that a general Boolean solution fulfills our design goals to be the preferable algorithm class for subscriptions that are more general than conjunctive sub- scriptions in universal settings: it is firstly more space-efficient, and secondly equally or more time-efficient. We therefore proved the first part of our central hypothesis (page 6):

In general-purpose pub-sub systems, a general Boolean filtering ap- proach requires less memory and achieves higher filter efficiency than a conjunctive filtering approach.

Having the means to support the central filtering of general Boolean sub- scriptions, we also need to support this class of subscriptions in the routing algorithms of content-based pub-sub systems. We proceed with this step in the next chapter.

Routing Optimizations for

General Boolean Subscriptions

T

he support of general Boolean subscriptions in a filtering algorithm,as proposed in Chapter 4 and evaluated in Chapter 5, is only the first step towards the provision of a content-based pub-sub system for a general Boolean pub-sub model. The second step concerns the routing in the dis- tributed system, in particular the subscription-based routing optimizations that currently only support conjunctive subscriptions and thus are not appli- cable (see Section 2.5, page 47).

We take this step within this chapter and propose the first subscription- based routing optimizations for general Boolean subscriptions, including re- stricted conjunctive forms. The proposed optimizations follow a different opti- mization principle than current solutions, allowing for the combination of our novel and recent optimizations. For the following descriptions, we assume sub- scription forwarding or rendezvous nodes (see Section 2.4, page 42) as routing algorithms.

The structure of this chapter is as follows: in Section 6.1 we introduce the general idea and principle of our optimization proposals. The first optimiza- tion, predicate replacement, is presented in Section 6.2. Subscription pruning, our second and more advanced optimization, is proposed in Section 6.3. Our subscription pruning approach allows for the optimization of content-based pub-sub systems with respect to various target parameters. In Section 6.4 we describe how to tailor the general subscription pruning optimization to these parameters. Subscription pruning can be applied in three different ways; they are investigated in Section 6.5. The practical implementation of the optimiza-

tion is the focus of Section 6.6. Finally, we present related work in Section 6.7.

6.1

Optimization Idea

Current subscription-based routing optimizations, that is, subscription cover- ing, merging, and summarization, aim at reducing the number of event routing table entries, as described in Section 2.5. However, there are several disadvan- tages of these approaches. Firstly, the potential of such a reduction depends on the existence of certain relationships (e.g., subset relationships or similarities) among the registered subscriptions. Secondly, the discovery of these relation- ships mostly requires the relation of all subscriptions with each other, leading to complex computation problems for general Boolean expressions. Thirdly, having applied these recent optimizations, the deregistration of subscriptions might require a network- and time-consuming processing. We refer to Sec- tion 2.5 for a detailed overview of these optimizations and an analysis of their properties.

In this chapter we follow a different optimization idea than current ap- proaches. Our design goals are to solve the common problems of existing routing optimizations, as summarized before and identified in Section 2.5.5 (page 58). We want to provide an optimization that:

1. is applicable to all kinds of Boolean subscriptions, including restricted conjunctive ones.

2. does not depend on the covering relationships among subscriptions. 3. does not increase the complexity of deregistrations compared to un-

optimized routing.

4. increases the overall routing efficiency of the system.

5. decreases the memory requirements for event routing tables.

Fulfilling these goals, we can ultimately prove Part 2a of our central hypothesis (page 6):

Subscription pruning increases system efficiency and decreases rout- ing table size, independently of the existing covering relationships. To achieve our design goals, our optimizations manipulate the entries in event routing tables on an individual basis instead of relating them to each other, as current optimizations do.

Forwarded messages

Broker

Un−optimized situation

Broker

Incoming messages Forwarded messages

Correct optimization Erroneous optimization Broker Forwarded messages Incoming messages Incoming messages e1 e2 e3 e2 e3 e1 e2 e3 e2 e3 e1 e1 e2 e3 e2

Figure 6.1: Schematic overview of an erroneous (bottom left) and a correct optimization (bottom right) of the un-optimized situation given at the top: the un-optimized situation forwards events e2 and e3 to a certain neighbor broker,

whereas an erroneous optimization only forwards e2 and a correct optimization

e1, e2, and e3.