1function demandEst = infer_rps(rt,
class, ql, V)
2% INFER_RPS Regression
for Processor Sharing (RPS) demand estimation
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
10% Based on mean-value analysis
for PS stations. For a single server:
12% E[R_r] = E[D_r] * E[Q_bar_A]
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:
18% E[R_r] = E[D_r] * E[Q_bar_A] / V
20% The demand E[D_r]
is estimated via non-negative least squares
21% regression of response times against Q_bar_A / V.
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.
28% Copyright (c) 2012-2026, Imperial College London
33demandEst = zeros(1, R);
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);