25.01.2015 Views

Cost-Based Optimization of Integration Flows - Datenbanken ...

Cost-Based Optimization of Integration Flows - Datenbanken ...

Cost-Based Optimization of Integration Flows - Datenbanken ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5 Multi-Flow <strong>Optimization</strong><br />

• Case 2: ∆tw > W (P ′ ) (Figure 5.10): The execution time is shorter than the waiting<br />

time. This can improve the throughput and is advantageous for multiple plans.<br />

• Case 3: ∆tw < W (P ′ ): The waiting time is shorter than the execution time. Thus,<br />

the result would be (1) temporally overlapping plan instances for different partitions<br />

or (2) growing message queue sizes (increasing k ′ ).<br />

Problem 5.5 (Waiting Time Inconsistency). When computing the waiting time ∆tw, we<br />

must prevent case 3 (∆tw < W (P ′ )) because it would lead to the parallel execution <strong>of</strong><br />

plan instances, where we could not ensure serialization. Furthermore, there might be an<br />

a-priori violated latency constraint with T L (M ′ ) ≥ lc or the latency constraint lc might be<br />

set to impossible values with regard to the execution time W (P ′ ).<br />

In order to overcome Problem 5.5, we define the validity condition: For a given latency<br />

constraint lc, there must exist a waiting time ∆tw such that (0 ≤ W (P ′ ) ≤ ∆tw) ∧ (0 ≤<br />

ˆT L (M ′ ) ≤ lc); otherwise, the constraint is invalid. In other words, (1) we avoid case 3, and<br />

(2) we check if the worst-case latency <strong>of</strong> a single message—in the sense <strong>of</strong> the estimated<br />

total latency <strong>of</strong> 1/sel distinct partitions—fulfills the latency constraint lc.<br />

5.3.2 Extended <strong>Cost</strong> Model and <strong>Cost</strong> Estimation<br />

In order to estimate the costs <strong>of</strong> plan instances for specific batch sizes k ′ with k ′ = |b i |,<br />

which is required for computing the optimal waiting time, we need to adapt the used cost<br />

model for integration flows that has been described in Subsection 3.2.2. Basically, only<br />

operators that benefit from partitioning require extensions.<br />

The cost model extensions address the abstract costs as well as the execution time<br />

because interaction-, control-flow-, and data-flow-oriented operators are affected by partitioning.<br />

Table 5.2 shows these extended costs C(o ′ i , k′ ) and execution times W (o ′ i , k′ ) in<br />

detail. The extended costs <strong>of</strong> operators that directly benefit from partitioning, namely<br />

Invoke, Receive, Switch, and Assign, are independent <strong>of</strong> the number <strong>of</strong> messages k ′ .<br />

For example, the Invoke operator executes an external query once for the whole batch.<br />

Further, also the Switch operator evaluates its path expressions on the partitioning attribute<br />

and thus, for the whole batch rather than on individual messages. However, the<br />

Switch operator recursively contains the extended costs <strong>of</strong> arbitrary child operators that<br />

might benefit from partitioning or not. In contrast, the costs <strong>of</strong> all other operators (that<br />

do not benefit from partitioning) linearly depend on the number <strong>of</strong> messages in the batch<br />

k ′ . This is also true for Invoke, Receive, Switch, and Assign operators if they do not<br />

Table 5.2: Extended Double-Metric Operator <strong>Cost</strong>s for Message Partitions<br />

Operator Abstract Execution Time W (o ′ i , k′ )<br />

Name <strong>Cost</strong>s C(o ′ i , k′ )<br />

Invoke |ds in | + |ds out | W (o i )<br />

Receive |ds out |<br />

⎛ ⎛<br />

W (o i )<br />

⎞⎞<br />

n∑<br />

i∑<br />

Switch |ds in |<br />

⎝P (path i ) · ⎝ W ( ) ∑m i<br />

expr pathj + W ( o ′ i,l, k ′) ⎠⎠<br />

Assign |ds in | + |ds out | W (o i )<br />

other C(o i ) · k ′ W (o i ) · k ′<br />

i=1<br />

j=1<br />

l=1<br />

144

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!