[comp.os.research] accuracy versus sampling frequency

mehra@aquinas.csl.uiuc.edu (Pankaj Mehra) (11/15/90)

How accurate are the measurements of performance provided by the kernel?
We(*) believe that the answer depends on how fast you sample them. On typical
UNIX (TM) implementations, the CPU state vector (which tells how much
time was spent in user/system/nice/idle modes) is updated at a frequency
of HZ (kernel parameter) hz.

Consider the case when HZ is 50 (typical on SMI's Sun 3/50 workstations).
If you sample every 10**6/HZ microseconds, and you are looking for idle
versus non-idle cycles, the instantaneous value of %CPU busy, defined
	      cycles spent non-idle
	      --------------------- x 100
	      total cycles elapsed
is going to be 0% or 100%. Now, reduce the sampling period to 0.5(10**6/HZ).
The resolution will improve to 0%, 50%, or 100% busy. And, so on.

Thus, the minimum resolution of raw (unaveraged) measurements places an
upper bound on sampling frequency, if one is trying to measure resource
utilization.

We found this of particular importance in designing physical level workload
generators, because sampling frequency imposes a bound on generation frequency.
The latter further bounds crucial parameters of load generators.

One obvious solution is to have dedicated hardware counters for performance
measurement of critical resources. The second, having a separate, faster clock,
for more frequent updates of statistics by the kernel. What other solutions
are known?

If you have seen other research along similar lines, please let me know. I
personally find this issue fairly fundamental to design and measurement. I
am in the process of developing a theory along these lines and the most
significant parts study the consequences of these limitations on averaging
and smoothing techniques. So, I'd like to make sure that I am on the right
track. Please e-mail your responses.

- Pankaj Mehra {p-mehra@uiuc.edu}
(*) Joint work with Prof. B. Wah