LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
infer_rps.m
1function demandEst = infer_rps(rt, class, ql, V)
2% INFER_RPS Regression for Processor Sharing (RPS) demand estimation
3%
4% RT: response time samples (column vector with all samples)
5% CLASS: class of each request sample (column vector)
6% QL: queue length samples (matrix with R columns containing the
7% number of jobs of each class observed by each sample)
8% V: number of cores/servers
9%
10% Based on mean-value analysis for PS stations. For a single server:
11%
12% E[R_r] = E[D_r] * E[Q_bar_A]
13%
14% where Q_bar_A is the total number of jobs seen upon admission,
15% including the arriving job itself. For V > 1 processors, the
16% queue length is split equally among the servers:
17%
18% E[R_r] = E[D_r] * E[Q_bar_A] / V
19%
20% The demand E[D_r] is estimated via non-negative least squares
21% regression of response times against Q_bar_A / V.
22%
23% Note: RPS assumes equal splitting among all V servers, which can
24% lead to overestimation under low loads when fewer than V servers
25% are actually busy. ERPS improves on this by using the mean number
26% of busy servers instead of V.
27%
28% Copyright (c) 2012-2026, Imperial College London
29% All rights reserved.
30
31R = max(class);
32
33demandEst = zeros(1, R);
34for r = 1:R
35 idx = (class == r);
36 respTimes = rt(idx);
37 % Q_bar_A: total jobs seen upon admission including the arriving job
38 qBarA = sum(ql(idx, :), 2) + 1;
39 demandEst(r) = lsqnonneg(qBarA / V, respTimes);
40end
41end