2 % @brief Nelson-Tantawi approximation
for K-way F/J response time
4 % @author LINE Development Team
8 % @brief Nelson-Tantawi approximation
for K-way F/J response time
11 % Computes an approximate mean response time
for a K-way Fork-Join
12 % queueing system with Poisson arrivals and exponential service times.
13 % Valid
for 2 <= K <= 32.
15 % R_K^{F/J}(rho) ≈ [H_K/H_2 + (1 - H_K/H_2) * 4*rho/11] * (1.5 - rho/8) / (mu - lambda)
17 % The approximation
is based on the exact 2-way solution and a scaling
18 % approximation that upper and lower bounds increase at the same rate.
19 % The coefficient alpha(rho) ≈ 4*rho/11 was obtained from simulation.
23 % R = fj_respt_nt(K, lambda, mu)
28 % <tr><th>Name<th>Description
29 % <tr><td>K<td>Number of parallel servers (2 <= K <= 32)
30 % <tr><td>lambda<td>Arrival rate
31 % <tr><td>mu<td>Service rate (mu > lambda
for stability)
36 % <tr><th>Name<th>Description
37 % <tr><td>R<td>Approximate K-way F/J response time R_K^{F/J}(rho)
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. (3) on page 17:10.
45 % Original: R. Nelson and A.N. Tantawi,
"Approximate Analysis of Fork/Join
46 % Synchronization in Parallel Queues", IEEE Trans. Computers, 37(6), 1988.
48function R = fj_respt_nt(K, lambda, mu)
51 line_error(mfilename,
'Nelson-Tantawi approximation requires K >= 2. Got K=%d.', K);
55 line_warning(mfilename,
'Nelson-Tantawi approximation was validated for K <= 32. Using K=%d may have reduced accuracy.', K);
62 line_error(mfilename,
'System is unstable: rho = lambda/mu = %.4f >= 1. Require lambda < mu.', rho);
65% Compute harmonic numbers
67H_2 = fj_harmonic(2); % H_2 = 1.5
69% Nelson-Tantawi approximation (Eq. 3):
70% R_K^{F/J}(rho) ≈ [H_K/H_2 + (1 - H_K/H_2) * 4*rho/11] * (1.5 - rho/8) * (mu - lambda)^{-1}
71S_K = H_K / H_2 + (1 - H_K / H_2) * (4 * rho / 11);
72R_2_factor = 1.5 - rho / 8; % This
is (H_2 - rho/8)
73R_rho = 1 / (mu - lambda);
75R = S_K * R_2_factor * R_rho;