1function percentileRT_K = mainFJ( arrival, service, pers, K, Cs, T_mode )
3% If you use the scripts available here in your work, please cite our paper
4% entitled
'Beyond the Mean in Fork-Join Queues: Efficient Approximation
5% for Response-Time Tails' (IFIP Performance 2015).
7% This function implements the approximation method proposed in the paper.
8% It returns the approximated values of the
RT percentiles
for a K-node FJ queue
9% according to Section 6 of the paper.
10% The
RT percentiles
for 1-node queue
is exact,
while the results
for a
11% 2-node FJ queue are based on the approximation proposed in Section 4,
13% % arrival
is a structure that must contain arrival.lambda, arrival.lambda0
14% and arrival.lambda1, where lambda
is the mean arrival rate, lambda0
is
15% the intensity-matrix
for state changes in the arrival process not
16% accompanied by arrivals and lambda1
is the intensity-matrix
for state
17% changes accompanied by arrivals.
19% % service
is a structure that must contain service.mu, service.ST,
20% service.tau_st, where mu
is the mean service rate, and tau_st and ST
21% corresponds to the PH representation (tau_st,ST)
for the service time
22% of each of the homogeneous K servers.
24% % pers are the targeted percentiles, e.g., 90-th, 95-th and 99-th.
26% % K
is the number of
nodes in the FJ queue, e.g., K=16 represents a
29% % Cs: limits of the value C as introduced in Section 4.
30% The larger the C, the more accurate the results.
32% % This function returns a cell, in which each element
is a structure
33% with the following properties:
34% K: number of
nodes, i.e., K-node FJ queue
35% percentiles: the targeted percentiles, e.g., 95-th percentile
36% RTp: response time percentiles according to percentiles
38% Script example.m shows an example of how to use
this function.
41% % Two methods are provided to solve the T matrix: (
default:
'NARE')
42%
'Sylves' : solves a Sylvester matrix equation at each step
43% using a Hessenberg algorithm
44%
'NARE ' : solves the Sylvester matrix equation by defining
45% a non-symmetric algebraic Riccati equation (NARE)
51load = arrival.lambda/service.mu;
53 error(
'System not stable: mean arrival rate %d > mean service rate %d',arrival.lambda,service.mu);
60 % the
RT percentiles
for 1-node queue
61 percentileRT_1 = returnRT1(arrival, service, pers);
63 % the
RT percentiles
for 2-node FJ queues
64 percentileRT_2 = returnRT2(arrival, service, pers, C, T_mode);
68% predict the response time percentiles based on the results of the 1-node
69% and 2-node FJ queue with the same setting
70percentileRT_K = cell(1,length(K));
72 percentileRT_K{k}.K = K(k);
73 percentileRT_K{k}.percentiles = 100*pers;
74 percentileRT_K{k}.RTp = zeros(1,length(pers));
75 for p = 1 : length(pers)
76 percentileRT_K{k}.RTp(p) = percentileRT_1(p,2)+(percentileRT_2(p,2)-percentileRT_1(p,2))*log(K(k))/log(2);