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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.3 Periodical Re-<strong>Optimization</strong><br />

<strong>Based</strong> on this waiting time, we compute the hypothetical total latency time <strong>of</strong><br />

ˆT L (M ′ , R, ∆tw) =<br />

⌈ ⌉ 1<br />

sel<br />

= 100 · 1.8056 s +<br />

· ∆tw + W (P ′ , R · ∆tw)<br />

(<br />

0.325 + 0.205 · 4 1 )<br />

· 1.8056 s ≈ 182.3656 s.<br />

s<br />

Finally, we check the validity conditions <strong>of</strong> (0 ≤ W (P 2 ′, k′ ) ≤ ∆tw) ∧ (0 ≤ ˆT L ≤ lc), where<br />

we observe that all constraints are given 15 . Comparing instance-based and partitioned<br />

execution with regard to executing for example |M| = 1,000 messages, we reduced the total<br />

⌈<br />

latency time from ˆT L (M) = 1,000 · 0.53 s = 530 s (simplified due to overload situation) to<br />

1,000/(4<br />

1<br />

s ) · 1.8056 s⌉ · 1.8056 s + 1.8056 s = 252.784 s and the total execution time from<br />

530 s to 250.978 s (W (M, k ′ ) = ˆT L (M, k ′ ) + ∆tw because we computed ∆tw according to<br />

the lower border <strong>of</strong> the defined interval).<br />

The whole computation approach is designed for the general case <strong>of</strong> arbitrary cost<br />

functions. <strong>Based</strong> on the observation that our concrete extended cost model only uses<br />

two categories <strong>of</strong> operator costs (operators that are independent <strong>of</strong> k ′ and operators that<br />

depend linearly on k ′ ), we use an efficient tailor-made waiting time computation algorithm<br />

as a simplification <strong>of</strong> this computation approach. In contrast to the general solution <strong>of</strong><br />

computing the optimal waiting time, this algorithm does not require the derivation <strong>of</strong> the<br />

latency time function.<br />

Algorithm 5.3 Waiting Time Computation (A-WTC)<br />

Require: rewritten plan P ′ , message rate R, latency constraint lc, selectivity sel<br />

1: ∆tw ← 0, k ′ ← 0, W − (P ′ ) ← 0, W + (P ′ ) ← 0<br />

2: for i ← 1 to m do // for each operator o i<br />

3: if W (o ′ i ) is independent <strong>of</strong> k′ then<br />

4: W − (P ′ ) ← W − (P ′ ) + W (o ′ i )<br />

5: else<br />

6: W + (P ′ ) ← W + (P ′ ) + W (o ′ i )<br />

7: ∆tw ← W − (P ′ )<br />

// ∆tw = W (P ′ , ∆tw · R) = W − (P ′ ) + W + (P ′ ) · ∆tw · R<br />

1−W + (P ′ )·R<br />

8: T L ← ⌈ 1<br />

sel⌉<br />

· ∆tw + W (P ′ , R · ∆tw)<br />

9: k ′ ← R · ∆tw<br />

10: if ¬(0 ≤ W (P ′ , k ′ ) ≤ ∆tw) ∨ ¬(0 ≤ ˆT L ≤ lc) then<br />

11: k ′ ← k ′ | W (M ′ , k ′ ) + ∆tw = T L (M ′ , k ′ ) = lc // overload situation<br />

12: return ∆tw, R, k ′<br />

Algorithm 5.3 illustrates this automatic waiting time computation approach for a given<br />

message rate R, the latency constraint lc, and number <strong>of</strong> distinct items sel. First, there<br />

are some initialization steps (line 1). Then, we iterate over the operators <strong>of</strong> the rewritten<br />

plan P ′ (lines 2-6) in order to compute the costs W − (P ) that are independent <strong>of</strong> k ′ and<br />

the costs W + (P ) that depend linearly on k ′ . Using a simplified Equation 5.8, we compute<br />

15 In this example, the result depends on the message arrival rate R. For example, R = 10 msg /s would result<br />

in an invalid waiting time ∆tw ≈ −0.3095 s. In this case we would try to compute ˆT L(M ′ , R · ∆tw) =<br />

W (M ′ , ∆tw · R) but would observe an overload situation and therefore, would proceed accordingly and<br />

compute the maximum batch size k ′′ .<br />

149

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

Saved successfully!

Ooh no, something went wrong!