Section 2.1. Tools for CPU Analysis


2.1. Tools for CPU Analysis

A number of different tools analyze CPU activity. The following summarizes both these tools and the topics covered in this section.

  • Utilization. Overall CPU utilization can be determined from the idle (id) field from vmstat, and the user (us) and system (sy) fields indicate the type of activity. Heavy CPU saturation is more likely to degrade performance than is CPU utilization.

  • Saturation. The run queue length from vmstat (kthr:r) can be used as a measure of CPU saturation, as can CPU latency time from prstat -m.

  • Load averages. These numbers, available from both the uptime and prstat commands, provide 1-, 5-, and 15-minute averages that combine both utilization and saturation measurements. This value can be compared to other servers if divided by the CPU count.

  • History. sar can be activated to record historical CPU activity. This data can identify long-term patterns; it also provides a reference for what CPU activity is "normal."

  • Per-CPU utilization. mpstat lists statistics by CPU, to help identify application scaling issues should CPU utilization be unbalanced.

  • CPU by process. Commands such as ps and prstat can be used to identify CPU consumption by process.

  • Microstate accounting. High-resolution time counters track several states for user threads; prstat -m reports the results.

  • DTrace analysis. DTrace can analyze CPU consumption in depth and can measure events in minute detail.

Table 2.1 summarizes the tools covered in this chapter, cross-references them, and lists the origin of the data that each tool uses.

Table 2.1. Tools for CPU Analysis

Tool

Uses

Description

Reference

vmstat

Kstat

For an initial view of overall CPU behavior

2.2 and 2.12.1

psrinfo

Kstat

For physical CPU properties

2.5

uptime

getloadavg()

For the load averages, to gauge recent CPU activity

2.6 and 2.12.2

sar

Kstat, sadc

For overall CPU behavior, and dispatcher queue statistics; sar also allows historical data collection

2.7 and 2.12.1

mpstat

Kstat

For per-CPU statistics

2.9

prstat

procfs

To identify process CPU consumption

2.10 and 2.11

dtrace

DTrace

For detailed analysis of CPU activity, including scheduling events and dispatcher analysis

2.13, 2.14, and 2.15





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