LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
fj_respt_varki.m
1%{ @file fj_respt_varki.m
2 % @brief Varki et al. approximation for K-way F/J response time
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Varki et al. approximation for K-way F/J response time
9 %
10 % @details
11 % Computes an approximate mean response time for a K-way Fork-Join
12 % queueing system with Poisson arrivals and exponential service times.
13 % This is the mean of pessimistic (upper) and optimistic (lower) bounds.
14 %
15 % R_K^{F/J}(rho) ≈ (1/mu) * [H_K + (rho/(2*(1-rho))) * (S1 + (1-2*rho)*S2)]
16 %
17 % where:
18 % S1 = sum_{i=1}^{K} 1/(i - rho)
19 % S2 = sum_{i=1}^{K} 1/(i*(i - rho))
20 %
21 % @par Syntax:
22 % @code
23 % R = fj_respt_varki(K, lambda, mu)
24 % @endcode
25 %
26 % @par Parameters:
27 % <table>
28 % <tr><th>Name<th>Description
29 % <tr><td>K<td>Number of parallel servers (positive integer)
30 % <tr><td>lambda<td>Arrival rate
31 % <tr><td>mu<td>Service rate (mu > lambda for stability)
32 % </table>
33 %
34 % @par Returns:
35 % <table>
36 % <tr><th>Name<th>Description
37 % <tr><td>R<td>Approximate K-way F/J response time R_K^{F/J}(rho)
38 % </table>
39 %
40 % @par Reference:
41 % A. Thomasian, "Analysis of Fork/Join and Related Queueing Systems",
42 % ACM Computing Surveys, Vol. 47, No. 2, Article 17, July 2014.
43 % Table I, Eq. (5) on page 17:10.
44 %
45 % Original: E. Varki, A. Merchant, J. Xu, and X. Qiu, "Issues and Challenges
46 % in the Performance Analysis of Real Disk Arrays", IEEE Trans. Parallel
47 % Distrib. Syst., 25(6), 2014 (published as Varki et al. [2013] in draft).
48%}
49function R = fj_respt_varki(K, lambda, mu)
50
51if K < 1
52 line_error(mfilename, 'K must be a positive integer. Got K=%d.', K);
53end
54
55% Compute utilization
56rho = lambda / mu;
57
58if rho >= 1
59 line_error(mfilename, 'System is unstable: rho = lambda/mu = %.4f >= 1. Require lambda < mu.', rho);
60end
61
62% Compute harmonic number H_K
63H_K = fj_harmonic(K);
64
65% Compute S1 = sum_{i=1}^{K} 1/(i - rho)
66S1 = sum(1 ./ ((1:K) - rho));
67
68% Compute S2 = sum_{i=1}^{K} 1/(i*(i - rho))
69S2 = sum(1 ./ ((1:K) .* ((1:K) - rho)));
70
71% Varki et al. approximation (Eq. 5):
72% R_K^{F/J}(rho) ≈ (1/mu) * [H_K + (rho/(2*(1-rho))) * (S1 + (1-2*rho)*S2)]
73R = (1 / mu) * (H_K + (rho / (2 * (1 - rho))) * (S1 + (1 - 2 * rho) * S2));
74
75end