Section 2.10. Who Is Using the CPU?


2.10. Who Is Using the CPU?

The prstat command was introduced in Solaris 8 to provide real-time process status in a meaningful way (it resembles top, the original freeware tool written by William LeFebvre). prstat uses procfs, the /proc file system, to fetch process details (see proc(4)), and the getloadavg() syscall to get load averages.

$ prstat    PID USERNAME  SIZE   RSS STATE  PRI NICE       TIME  CPU PROCESS/NLWP  25639 rmc      1613M   42M cpu22    0   10    0:33:10 3.1% filebench/2  25655 rmc      1613M   42M cpu23    0   10    0:33:10 3.1% filebench/2  25659 rmc      1613M   42M cpu30    0   10    0:33:11 3.1% filebench/2  25644 rmc      1613M   42M cpu14    0   10    0:33:10 3.1% filebench/2  25658 rmc      1613M   42M cpu16    0   10    0:33:10 3.1% filebench/2  25636 rmc      1613M   42M cpu21    0   10    0:33:10 3.1% filebench/2  25646 rmc      1613M   42M cpu15    0   10    0:33:10 3.1% filebench/2  25661 rmc      1613M   42M cpu8     0   10    0:33:11 3.1% filebench/2  25652 rmc      1613M   42M cpu20    0   10    0:33:09 3.1% filebench/2  25647 rmc      1613M   42M cpu0     0   10    0:33:10 3.1% filebench/2  25641 rmc      1613M   42M cpu27    0   10    0:33:10 3.1% filebench/2  25656 rmc      1613M   42M cpu7     0   10    0:33:10 3.1% filebench/2  25634 rmc      1613M   42M cpu11    0   10    0:33:11 3.1% filebench/2  25637 rmc      1613M   42M cpu17    0   10    0:33:10 3.1% filebench/2  25643 rmc      1613M   42M cpu12    0   10    0:33:10 3.1% filebench/2  25648 rmc      1613M   42M cpu1     0   10    0:33:10 3.1% filebench/2  25640 rmc      1613M   42M cpu26    0   10    0:33:10 3.1% filebench/2  25651 rmc      1613M   42M cpu31    0   10    0:33:10 3.1% filebench/2  25654 rmc      1613M   42M cpu29    0   10    0:33:10 3.1% filebench/2  25650 rmc      1613M   42M cpu5     0   10    0:33:10 3.1% filebench/2  25653 rmc      1613M   42M cpu10    0   10    0:33:10 3.1% filebench/2  25638 rmc      1613M   42M cpu18    0   10    0:33:10 3.1% filebench/2 Total: 91 processes, 521 lwps, load averages: 29.06, 28.84, 26.68 


The default output from the prstat command shows one line of output per process, including a value that represents recent CPU utilization. This value is from pr_pctcpu in procfs and can express CPU utilization before the prstat command was executed (see Section 2.12.3).

The system load average indicates the demand and queuing for CPU resources averaged over a 1-, 5-, and 15-minute period. They are the same numbers as printed by the uptime command (see Section 2.6). The output in our example shows a load average of 29 on a 32-CPU system. An average load average that exceeds the number of CPUs in the system is a typical sign of an overloaded system.




Solaris Performance and Tools(c) Dtrace and Mdb Techniques for Solaris 10 and Opensolaris
Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and OpenSolaris
ISBN: 0131568191
EAN: 2147483647
Year: 2007
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net