1

i have very simple question: When Im using Iperf3 with my server and on client i add paramater -V which mean it will display more detailed information it's display information about CPU utilization on server and client. Example of displayed information:

CPU Utilization: local/sender 0.2% (0.1%u/0.1%s), remote/receiver 11.5% (7.7%u/3.9%s)

I don't know what these letters 'u' and 's' mean so that is my question, looking for your help.

1
  • 2
    My guess - user and system.
    – DavidPostill
    Commented Dec 4, 2016 at 22:03

1 Answer 1

1

DavidPostill's comment is correct: they stand for user and system, respectively. To prove it, let's look at the code.

We find the string "CPU Utilization" in iperf_locale.c. This file appears to have all the language-specific strings, and the variable for the line that reports CPU usage is called report_cpu.

const char report_cpu[] =
"CPU Utilization: %s/%s %.1f%% (%.1f%%u/%.1f%%s), %s/%s %.1f%% (%.1f%%u/%.1f%%s)\n";

We find that variable used in iperf_api.c. The function used there seems to be more or less similar to printf, which takes a format string (our report_cpu) and replaces all the placeholders in it with a human-readable version of the given variables.

iperf_printf(test, report_cpu, report_local, test->sender?report_sender:report_receiver, test->cpu_util[0], test->cpu_util[1], test->cpu_util[2], report_remote, test->sender?report_receiver:report_sender, test->remote_cpu_util[0], test->remote_cpu_util[1], test->remote_cpu_util[2]);

The fourth and fifth placeholders, the %.1fs inside the parentheses, are what we're investigating. It looks like the first two parameters to the function are some kind of context and the template string, respectively, so we'll start counting at the report_local one. The fourth is test->cpu_util[1]. Some digging reveals that these three-valued cpu_util arrays are generated in iperf_util.c. The interesting part is at the very end of the cpu_util function:

pcpu[0] = (((ctemp - clast) * 1000000.0 / CLOCKS_PER_SEC) / timediff) * 100;
pcpu[1] = (userdiff / timediff) * 100;
pcpu[2] = (systemdiff / timediff) * 100;

Slots 1 and 2 are indeed based on the user time and the system time, respectively, while slot 0 is the total usage.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .