1

As the title says, the mpstat command, executed on Slack 13.0 continuously shows almost no processor utilization of any sort. In fact none of the output ever seems to change at all. The system is dual processor board with two hyperthreaded P4 Xeons. Any ideas?

08:50:06 PM  CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
08:50:06 PM  all    0.38    0.00    0.03    0.03    0.00    0.00    0.00   99.56   1510.46
08:50:06 PM    0    0.50    0.00    0.05    0.10    0.00    0.01    0.00   99.33     11.90
08:50:06 PM    1    0.32    0.00    0.03    0.01    0.00    0.00    0.00   99.64      0.00
08:50:06 PM    2    0.38    0.00    0.03    0.01    0.00    0.00    0.00   99.58      0.00
08:50:06 PM    3    0.29    0.00    0.02    0.00    0.00    0.00    0.00   99.68      0.00

This is the only output I can get from the program. No values change ever.

conartist6
  • 131
  • 4
  • As a note, TOP works fine. – conartist6 Jan 12 '11 at 18:17
  • As an interesting not both 'top' and 'vmstat 1' seem to display a behaviour which is not dissimilar: the first update both of those programs produce shows no CPU usage. The second update jumps to the appropriate numbers, with, say, loading one virtual core displaying 25% usage. I suppose I could, with a bit of hackery, just capture that output and use it... – conartist6 Jan 12 '11 at 18:26

1 Answers1

2

Seems to have been a misunderstanding. Mpstat prints avg's since system boot if it is not given any args, the documentation seems to have been a little unclear in its workding. To get one set of current statistics the command mpstat 1 1 can be issued, however it takes one second to return with the proper data.

conartist6
  • 131
  • 4
  • Thank you, this was driving me insane. I'm assuming it takes a second to run as it reads the /proc/stat counters, and has to take 2 readings. See http://stackoverflow.com/questions/3017162/how-to-get-total-cpu-usage-in-linux-c – rusvdw Mar 07 '11 at 18:42