被问了那些问题
来源:互联网 发布:路由器网络延时 编辑:程序博客网 时间:2024/03/29 17:18
顺便附上linux 命令行格式: http://www.cnblogs.com/CGDeveloper/archive/2011/05/27/2060009.html
那些命令可以查看磁盘 io 操作 iostat
sudo apt-get install sysstat
IOSTAT(1) Linux User's Manual IOSTAT(1)
NAME
iostat - Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions.
-报告CPU的信息, 和设备,分区的输入输出
SYNOPSIS
iostat [ -c ] [ -d ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ] [ device [...] | ALL ] [ -p [ device [,...] | ALL ] ]
[ interval [ count ] ]
DESCRIPTION
The iostat command is used for monitoring system input/output device loading by observing the time the devices are active
in relation to their average transfer rates. The iostat command generates reports that can be used to change system con‐
figuration to better balance the input/output load between physical disks.
这个命令是用来监测系统输入输出设备的, 它通过监视设备激活时间和设备的传输速率来实现. 命令生成了报告,可以用来改变系统设置
以达到更好的物理磁盘输入/输出的平衡
The first report generated by the iostat command provides statistics concerning the time since the system was booted. Each
subsequent report covers the time since the previous report. All statistics are reported each time the iostat command is
run. The report consists of a CPU header row followed by a row of CPU statistics. On multiprocessor systems, CPU statis‐
tics are calculated system-wide as averages among all processors. A device header row is displayed followed by a line of
statistics for each device that is configured.
第一个由iostat生成的报告从系统启动开始. 每一个随后而来的报告从上一条报告开始. 执行一次iostat命令生成一起全部的统计信息.
报告由 一行CPU的头部,和若干行CPU数据组成. 在多处理器系统中,CPU的统计信息是由整个系统的平均值构成的. 一条设备头部行之后
是一条已经配置的每一设备的信息组成.
The interval parameter specifies the amount of time in seconds between each report. The first report contains statistics
for the time since system startup (boot). Each subsequent report contains statistics collected during the interval since
the previous report. The count parameter can be specified in conjunction with the interval parameter. If the count parame‐
ter is specified, the value of count determines the number of reports generated at interval seconds apart. If the interval
parameter is specified without the count parameter, the iostat command generates reports continuously.
时间间隔参数指定了在每条报告之间的时间(秒)数. 第一个报告包含了从系统启动至今的全部时间. 每一个随后的报告包含了从上一个
报告之后的时间间隔内的统计信息. 计数参数, 可以由时间间隔参数统一设定. 如果时间间隔参数在没有计数参数的情况下给出, 那么iostat
命令经产生连续不间断的报告.
REPORTS
The iostat command generates three types of reports, the CPU Utilization report, the Device Utilization report and the
Network Filesystem report.
命令残生三种类型的报告. CPU的使用情况, 设备使用情况, 网络文件系统报告
CPU Utilization Report
The first report generated by the iostat command is the CPU Utilization Report. For multiprocessor systems, the CPU
values are global averages among all processors. The report has the following format:
第一个由iostat生个的报告是CPU的使用情况报告. 对于多处理器系统, CPU的值是由全局的所有的CPU的平均值确定的. 报告的格式如下:
%user
Show the percentage of CPU utilization that occurred while executing at the user level (application).
显示用户态下,CPU使用百分比
%nice
Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
显示用户态下,有优先级的CPU使用百分比
%system
Show the percentage of CPU utilization that occurred while executing at the system level (kernel).
显示内核态下,CPU使用百分比
%iowait
Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk
I/O request.
显示高磁盘io情况下,CPU的闲置时间百分比
%steal
Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was
servicing another virtual processor.
在管理程序为另一个虚拟CPU服务时,其他CPU不情愿等待时间百分比
%idle
Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk
I/O request.
没有高io请求是CPU空转时间.
Device Utilization Report
The second report generated by the iostat command is the Device Utilization Report. The device report provides sta‐
tistics on a per physical device or partition basis. Block devices and partitions for which statistics are to be
displayed may be entered on the command line. If no device nor partition is entered, then statistics are displayed
for every device used by the system, and providing that the kernel maintains statistics for it. If the ALL keyword
is given on the command line, then statistics are displayed for every device defined by the system, including those
that have never been used. Transfer rates are shown in 1K blocks by default, unless the environment variable
POSIXLY_CORRECT is set, in which case 512-byte blocks are used. The report may show the following fields, depend‐
ing on the flags used:
报告的第二部分是设备使用情况使用说明. 设备报告中提供了每一个物理设备或者基础分区的数据. 块设备或者分区的数据可能
会由命令行指定. 如果没有指定设备或者分区, 统计信息会是每一个系统所用到的设备, 并且提供内核的维护数据. 如果所用的
选项都在命令中给出.统计信息会是每一个由系统定义的设备,包括哪些没有用过的. 传输速率会默认的以1K每块显示, 除非系统的
POSIXLY_CORRECT环境变量已经被设置, 这种情况下, 512 字节的块会被使用. 报告会包括以下的字段, 取决于flags.
Device:
This column gives the device (or partition) name as listed in the /dev directory.
tps
Indicate the number of transfers per second that were issued to the device. A transfer is an I/O request to
the device. Multiple logical requests can be combined into a single I/O request to the device. A transfer is
of indeterminate size.
Blk_read/s (kB_read/s, MB_read/s)
Indicate the amount of data read from the device expressed in a number of blocks (kilobytes, megabytes) per
second. Blocks are equivalent to sectors and therefore have a size of 512 bytes.
Blk_wrtn/s (kB_wrtn/s, MB_wrtn/s)
Indicate the amount of data written to the device expressed in a number of blocks (kilobytes, megabytes) per
second.
Blk_read (kB_read, MB_read)
The total number of blocks (kilobytes, megabytes) read.
Blk_wrtn (kB_wrtn, MB_wrtn)
The total number of blocks (kilobytes, megabytes) written.
rrqm/s
The number of read requests merged per second that were queued to the device.
wrqm/s
The number of write requests merged per second that were queued to the device.
r/s
The number (after merges) of read requests completed per second for the device.
w/s
The number (after merges) of write requests completed per second for the device.
rsec/s (rkB/s, rMB/s)
The number of sectors (kilobytes, megabytes) read from the device per second.
wsec/s (wkB/s, wMB/s)
The number of sectors (kilobytes, megabytes) written to the device per second.
avgrq-sz
The average size (in sectors) of the requests that were issued to the device.
avgqu-sz
The average queue length of the requests that were issued to the device.
await
The average time (in milliseconds) for I/O requests issued to the device to be served. This includes the
time spent by the requests in queue and the time spent servicing them.
r_await
The average time (in milliseconds) for read requests issued to the device to be served. This includes the
time spent by the requests in queue and the time spent servicing them.
w_await
The average time (in milliseconds) for write requests issued to the device to be served. This includes the
time spent by the requests in queue and the time spent servicing them.
svctm
The average service time (in milliseconds) for I/O requests that were issued to the device. Warning! Do not
trust this field any more. This field will be removed in a future sysstat version.
%util
Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the
device). Device saturation occurs when this value is close to 100%.
OPTIONS
-c Display the CPU utilization report.
-d Display the device utilization report.
-k Display statistics in kilobytes per second.
-m Display statistics in megabytes per second.
-N Display the registered device mapper names for any device mapper devices. Useful for viewing LVM2 statistics.
-p [ { device [,...] | ALL } ]
The -p option displays statistics for block devices and all their partitions that are used by the system. If a
device name is entered on the command line, then statistics for it and all its partitions are displayed. Last, the
ALL keyword indicates that statistics have to be displayed for all the block devices and partitions defined by the
system, including those that have never been used.
-t Print the time for each report displayed. The timestamp format may depend on the value of the S_TIME_FORMAT envi‐
ronment variable (see below).
-V Print version number then exit.
-x Display extended statistics.
-z Tell iostat to omit output for any devices for which there was no activity during the sample period.
ENVIRONMENT
The iostat command takes into account the following environment variables:
S_TIME_FORMAT
If this variable exists and its value is ISO then the current locale will be ignored when printing the date in the
report header. The iostat command will use the ISO 8601 format (YYYY-MM-DD) instead. The timestamp displayed with
option -t will also be compliant with ISO 8601 format.
POSIXLY_CORRECT
When this variable is set, transfer rates are shown in 512-byte blocks instead of the default 1K blocks.
EXAMPLES
iostat
Display a single history since boot report for all CPU and Devices.
iostat -d 2
Display a continuous device report at two second intervals.
iostat -d 2 6
Display six reports at two second intervals for all devices.
iostat -x sda sdb 2 6
Display six reports of extended statistics at two second intervals for devices sda and sdb.
iostat -p sda 2 6
Display six reports at two second intervals for device sda and all its partitions (sda1, etc.)
BUGS
/proc filesystem must be mounted for iostat to work.
Kernels older than 2.6.x are no longer supported.
The average service time (svctm field) value is meaningless, as I/O statistics are calculated at block level, and we don't
know when the disk driver starts to process a request. For this reason, this field will be removed in a future sysstat
version.
FILES
/proc/stat contains system statistics.
/proc/uptime contains system uptime.
/proc/diskstats contains disks statistics.
/sys contains statistics for block devices.
/proc/self/mountstats contains statistics for network filesystems.
AUTHOR
Sebastien Godard (sysstat <at> orange.fr)
SEE ALSO
sar(1), pidstat(1), mpstat(1), vmstat(8), nfsiostat(1), cifsiostat(1)
http://pagesperso-orange.fr/sebastien.godard/
Linux JUNE 2010 IOSTAT(1)
关于epoll 的解释
http://yaocoder.blog.51cto.com/2668309/888374
- 被问了那些问题
- 前几天参加了阿里巴巴的电话面试,把他们问的问题都记录了下来,希望对那些正准备面试的人有用。
- 面试时一定问清楚的那些问题!
- Java面试那些事--可能会问的那些问题(中高级篇)
- 友元解决了那些问题
- 那些年,被问过的Java面试题
- 今天被别人问了几个问题
- 去问了一下台湾签证问题……
- 劝告:分手了就不要再问的十个问题
- 内容市场策略:你问了错误的问题
- 求助~~知道不能问问题还是想问..没办法了
- 问问题
- 问问题
- [其他(请注明)] 提问的智慧:献给那些不会提问问问题的人
- 最近面试,被问到了一个约瑟夫环的问题,有空用循环数组写了一个
- 面试中经常被问到一个shell命令的问题,但是一直不会,被百度问了,赶紧回来查查
- 急问!菜鸟问问题
- 被问技术问题的经历分享
- Android Service学习之AIDL, Parcelable和远程服务
- hdu 1062 Text Reverse
- struts2 的一些问题解决
- 这几个月做了什么
- Web
- 被问了那些问题
- MyEclipse
- C++ 简单的单链表
- JavaBean
- truncate、delete、drop 的区别
- js的7大框架
- 第21,22天的交易(2013-4-18)(2013-4-19)(-100)(+100) (+41.82)
- JSP
- 开源软件架构:可扩展的Web架构与分布式系统