Solaris学习笔记(1)
作者: Badcoffee
Email: blog.oliver@gmail.com
Blog: http://blog.csdn.net/yayong
2005年6月
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | ATTRIBUTES | SEE ALSO | NOTES
The mpstat command reports processor statistics in tabular form. Each row of the table represents the activity of one processor. The first table summarizes all activity since boot. Each subsequent table summarizes activity for the preceding interval. All values are rates listed as events per second unless otherwise noted.
mpstat命令以列表形式报告处理器统计数据。表格的每行对应一个处理器的活动状态。第一个表格统计了从系统引导以来的所有活动数据。接下来
每个顺序的表统计了到之前表时间间隔的活动数据。除非特别注明,所有列出的数据是按照每秒种事件速率。
During execution of the kernel status command, the state
of the kernel can change. If relevant, a state change message is
included
in the mpstat output,
in one of the following forms:
在执行内核状态命令时,内核的状态会改变。如果相关,状态改变的信息被包括在mpstat的输出里,可以是下面的形式:
< |
The mpstat command reports the following information:
Without the -a option, mpstat reports CPU statistics for a processor ID. With the -a option, mpstat reports SET statistics for a processor set ID.
minor faults
major faults
inter-processor cross-calls
interrupts
interrupts as threads (not counting clock interrupt)
context switches
involuntary context switches
thread migrations (to another processor)
spins on mutexes (lock not acquired on first try)
spins on readers/writer locks (lock not acquired on first try)
system calls
percent user time
percent system time
time CPUs are idle pending I/O operations. See the NOTES section for more information on wt time.
percent idle time
number of processors in the requested processor set
processor set membership of each CPU
The following options are supported:
Aggregate output by processor set. Sort the output by set. The default output is sorted by CPU number.
Report processor set membership of each CPU. Sort the output by set. The default output is sorted by CPU number.
Display only those processors in the specified set.
Suppress messages related to state changes.
Report once each interval seconds.
Only print count reports.
例1 使用mpstat产生用户和系统操作统计数据
The following command generates processor statistics over a
five–second
interval in two reports. The command shows the processor set membership
of
each CPU. The default output is sorted by CPU number, aggregated by processor
set, for user (usr) and system (sys)
operations. See the NOTES section for more information on wt
time.
下面的命令以5秒的间隔产生了2个处理器的统计数据报告。命令显示了处理器集合与每个CPU的成员关系。默认用户和系统操作的输出是按照CPU
号,处理器集合排序。关于wt时间的更多信息请看NOTES小节。
example% mpstat -ap 5 2 |
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|---|---|
| Availability | SUNWcsu |
| Interface Stability | See below. |
Invocation is evolving. Human readable output is unstable.
sar(1), iostat(1M), sar(1M), vmstat(1M), attributes(5)
The sum of CPU utilization might vary slightly from 100 due to rounding errors in the production of a percentage figure.
CPU占用率的统计由于舍入错误,也许在百分比数字的总和略有不同,不是100。
The total time used for CPU processing is the sum of usr and sys output values, reported for user and system operations. The wt value reports the time that processors are idle pending I/O operations. The idl value reports the time that the CPU is idle for any reason other than pending disk I/O operations. The total amount of idle CPU time is, therefore, the sum of wt and idl output values.
CPU处理的总时间是用户和系统操作报告的值usr和值sys的和。值wt报告的是处理器空闲等待IO操作的时间。值idl报告的是CPU除去
等待磁盘IO操作外的因为任何原因而空闲的时间。CPU空闲的时间总数因此应该是wt和idl输出值之和。
High wt times indicate problems in the disk subsystem, not problems with CPUs or other processing elements. Excessive wt times must be addressed by improving the performance, especially the service times, of the busiest disk devices. Run the iostat command with the -x option to report I/O service times in svc_t output. The iostat utility also reports the same wt, user (us), and system (sy) statistics. See iostat(1M) for more information.
wt的时间高意味着磁盘子系统的问题,不是CPU和其他部分的问题。过高的wt时间必须通过提高性能,特别是最忙的磁盘设备的服务
时间来解决。
When executing in a zone and if the pools facility
is active, mpstat(1M)
will only provide information for
those processors which are a member of the processor set of the pool to
which
the zone is bound.
当在一个zone里执行,如果pools
facility处于活动状态,mpstat将只提供属于zone绑定的pool的处理器集合的成员的那些处理器的信息。
个人体会:mpstat与其它统计工具一样,不能够仅靠一个工具,或者工具报告的一个值就简单的给系统下结论。而且,统计数据的值到底达到多少
才算很高,也和系统的 配置,具体环境相关。分析系统性能,需要利用多个工具,相互印证,找出联系。Solaris
10推出的dtrace超越了传统的unix系统提供的性能工具,我们可以用dtrace的sysinfo provider来完成所有的性能分析工作。