日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux i o的使用情况,Linux下使用iostat 监视I/O状态

發(fā)布時間:2024/10/8 linux 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux i o的使用情况,Linux下使用iostat 监视I/O状态 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Linux下我們可以使用 sar(1), pidstat(1), mpstat(1), vmstat(8) 來監(jiān)控I/O狀態(tài)

一、安裝

yum install sysstat

二、參數解釋

FILES

/proc/stat contains system statistics.

/proc/uptime contains system uptime.

/proc/partitions contains disk statistics (for pre 2.5 kernels that have been patched).

/proc/diskstats contains disks statistics (for post 2.5 kernels).

/sys contains statistics for block devices (post 2.5 kernels).

/proc/self/mountstats contains statistics for network filesystems.

/dev/disk contains persistent device names.

CPU Utilization Report

%user? ? Show? the? percentage? of CPU utilization that occurred while executing at the user level (applica-tion).

%nice? Show the percentage of CPU utilization that occurred while executing at the user? level? with? nicepriority.

%system? ? Show? the percentage of CPU utilization that occurred while executing at the system level (kernel).

%iowait? ? Show the percentage of time that the CPU or CPUs were idle during which the system had an outstand-ing disk I/O request.

%steal? ? Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervi-sor was servicing another virtual processor.

%idle? ? Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstand-ing disk I/O request.

Device Utilization Report

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? ? Indicate the amount of data read from the device expressed in a number of blocks per second. Blocks

are equivalent to sectors with kernels 2.4 and later and therefore have a size of 512? bytes.? With

older kernels, a block is of indeterminate size.

Blk_wrtn/s? ? Indicate the amount of data written to the device expressed in a number of blocks per second.

Blk_read? ? The total number of blocks read.

Blk_wrtn? ? The total number of blocks written.

kB_read/s? ? Indicate the amount of data read from the device expressed in kilobytes per second.

kB_wrtn/s? ? Indicate the amount of data written to the device expressed in kilobytes per second.

kB_read? ? The total number of kilobytes read.

kB_wrtn? ? The total number of kilobytes written.

MB_read/s? ? Indicate the amount of data read from the device expressed in megabytes per second.

MB_wrtn/s? ? Indicate the amount of data written to the device expressed in megabytes per second.

MB_read? ? The total number of megabytes read.

MB_wrtn? ? The total number of 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 of read requests that were issued to the device per second.

w/s? ? The number of write requests that were issued to the device per second.

rsec/s? ? The number of sectors read from the device per second.

wsec/s? ? The number of sectors written to the device per second.

rkB/s? ? The number of kilobytes read from the device per second.

wkB/s? ? The number of kilobytes written to the device per second.

rMB/s? ? The number of megabytes read from the device per second.

wMB/s? ? The number of 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.

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%.

Network Filesystem report

rBlk_nor/s? ? Indicate the number of blocks read by applications via the read(2) system call interface.? A? block has a size of 512 bytes.

wBlk_nor/s? ? Indicate the number of blocks written by applications via the write(2) system call interface.

rBlk_dir/s? ? Indicate the number of blocks read from files opened with the O_DIRECT flag.

wBlk_dir/s? ? Indicate the number of blocks written to files opened with the O_DIRECT flag.

rBlk_svr/s? ? Indicate the number of blocks read from the server by the NFS client via an NFS READ request.

wBlk_svr/s? ? Indicate the number of blocks written to the server by the NFS client via an NFS WRITE request.

rkB_nor/s? ? Indicate the number of kilobytes read by applications via the read(2) system call interface.

wkB_nor/s? ? Indicate the number of kilobytes written by applications via the write(2) system call interface.

rkB_dir/s? ? Indicate the number of kilobytes read from files opened with the O_DIRECT flag.

wkB_dir/s? ? Indicate the number of kilobytes written to files opened with the O_DIRECT flag.

rkB_svr/s? ? Indicate the number of kilobytes read from the server by the NFS client via an NFS READ request.

wkB_svr/s? ? Indicate? the number of kilobytes written to the server by the NFS client via an NFS WRITE request.

rMB_nor/s? ? Indicate the number of megabytes read by applications via the read(2) system call interface.

wMB_nor/s? ? Indicate the number of megabytes written by applications via the write(2) system call interface.

rMB_dir/s? ? Indicate the number of megabytes read from files opened with the O_DIRECT flag.

wMB_dir/s? ? Indicate the number of megabytes written to files opened with the O_DIRECT flag.

rMB_svr/s? ? Indicate the number of megabytes read from the server by the NFS client via an NFS READ request.

wMB_svr/s? ? Indicate the number of megabytes written to the server by the NFS client via an NFS WRITE? request.

ops/s? ? Indicate the number of operations that were issued to the filesystem per second.

rops/s? ? Indicate the number of ’read’ operations that were issued to the filesystem per second.

wops/s? ? Indicate the number of ’write’ operations that were issued to the filesystem per second.

命令參數

-C 顯示CPU使用情況

-d 顯示磁盤使用情況

-k 以 KB 為單位顯示

-m 以 M 為單位顯示

-N 顯示磁盤陣列(LVM) 信息

-n 顯示NFS 使用情況

-p[磁盤] 顯示磁盤和分區(qū)的情況

-t 顯示終端和CPU的信息

-x 顯示詳細信息

-V 顯示版本信息

三、使用方式

Device Utilization Report

[root@localhost ~]# iostat -d -k 2 4

Linux 2.6.32-431.11.2.el6.x86_64 (localhost)? ? ? ? 01/08/2016? ? ? _x86_64_? ? ? ? (4 CPU)

Device:? ? ? ? ? ? tps? ? kB_read/s? ? kB_wrtn/s? ? kB_read? ? kB_wrtn

xvda? ? ? ? ? ? 114.22? ? ? ? 13.80? ? ? 713.21? 372234513 19241775188

xvdb? ? ? ? ? ? 19.26? ? ? ? 21.24? ? ? 144.25? 573067009 3891812336

Device:? ? ? ? ? ? tps? ? kB_read/s? ? kB_wrtn/s? ? kB_read? ? kB_wrtn

xvda? ? ? ? ? ? ? 0.00? ? ? ? 0.00? ? ? ? 0.00? ? ? ? ? 0? ? ? ? ? 0

xvdb? ? ? ? ? ? ? 4.50? ? ? ? 0.00? ? ? ? 18.00? ? ? ? ? 0? ? ? ? 36

Device:? ? ? ? ? ? tps? ? kB_read/s? ? kB_wrtn/s? ? kB_read? ? kB_wrtn

xvda? ? ? ? ? ? ? 0.00? ? ? ? 0.00? ? ? ? 0.00? ? ? ? ? 0? ? ? ? ? 0

xvdb? ? ? ? ? ? 10.50? ? ? ? 0.00? ? ? ? 42.00? ? ? ? ? 0? ? ? ? 84

Device:? ? ? ? ? ? tps? ? kB_read/s? ? kB_wrtn/s? ? kB_read? ? kB_wrtn

xvda? ? ? ? ? ? ? 0.00? ? ? ? 0.00? ? ? ? 0.00? ? ? ? ? 0? ? ? ? ? 0

xvdb? ? ? ? ? ? 20.50? ? ? ? 0.00? ? ? ? 86.00? ? ? ? ? 0? ? ? ? 172

參數說明

tps:該設備每秒的傳輸次數,多個邏輯請求可以組合成一個單一的 I/O 請求的設備。傳輸具有不確定的大小。

kB_read/s:每秒從設備讀取的數據量

kB_wrtn/s:每秒向設備寫入的數據量

kB_read:讀取的總數據量

kB_wrtn:寫入的總數量數據量

[root@localhost ~]# iostat -d -x -k 1 10

Linux 2.6.32-431.11.2.el6.x86_64 (localhost)? ? ? ? 01/08/2016? ? ? _x86_64_? ? ? ? (4 CPU)

Device:? ? ? ? rrqm/s? wrqm/s? ? r/s? ? w/s? ? rkB/s? ? wkB/s avgrq-sz avgqu-sz? await? svctm? %util

xvda? ? ? ? ? ? ? 0.02? ? 0.69? ? 0.56? 113.65? ? 13.80? 713.21? ? 12.73? ? 0.00? ? 0.03? 0.48? 5.53

xvdb? ? ? ? ? ? ? 0.02? ? 17.88? ? 1.07? 18.19? ? 21.24? 144.27? ? 17.19? ? 0.13? ? 6.71? 1.69? 3.25

Device:? ? ? ? rrqm/s? wrqm/s? ? r/s? ? w/s? ? rkB/s? ? wkB/s avgrq-sz avgqu-sz? await? svctm? %util

xvda? ? ? ? ? ? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? 0.00? 0.00

xvdb? ? ? ? ? ? ? 0.00? ? 0.00? ? 0.00? ? 5.00? ? 0.00? ? 20.00? ? 8.00? ? 0.11? 22.00? 4.40? 2.20

Device:? ? ? ? rrqm/s? wrqm/s? ? r/s? ? w/s? ? rkB/s? ? wkB/s avgrq-sz avgqu-sz? await? svctm? %util

xvda? ? ? ? ? ? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? ? 0.00? 0.00? 0.00

xvdb? ? ? ? ? ? ? 0.00? ? 0.00? ? 0.00? 16.00? ? 0.00? ? 64.00? ? 8.00? ? 0.80? 50.19? 6.81? 10.90

總IO(io)/s = r/s(讀) +w/s(寫)

平均等待時間 = 單個 I/O 服務時間 * ( 1 + 2 + … + 請求總數-1) / 請求總數

參數說明

rrqm/s:每秒進行 merge 的讀操作數目.即 delta(rmerge)/s

wrqm/s:每秒進行 merge 的寫操作數目.即 delta(wmerge)/s

r/s:每秒完成的讀 I/O 設備次數.即 delta(rio)/s

w/s:每秒完成的寫 I/O 設備次數.即 delta(wio)/s

rsec/s:每秒讀扇區(qū)數.即 delta(rsect)/s

wsec/s:每秒寫扇區(qū)數.即 delta(wsect)/s

rkB/s:每秒讀K字節(jié)數.是 rsect/s 的一半,因為每扇區(qū)大小為512字節(jié).(需要計算)

wkB/s:每秒寫K字節(jié)數.是 wsect/s 的一半.(需要計算)

avgrq-sz: 平均每次設備I/O操作的數據大小 (扇區(qū)).delta(rsect+wsect)/delta(rio+wio)

avgqu-sz: 平均I/O隊列長度.即 delta(aveq)/s/1000 (因為aveq的單位為毫秒).

await:平均每次設備I/O操作的等待時間 (毫秒).即 delta(ruse+wuse)/delta(rio+wio)

svctm:平均每次設備I/O操作的服務時間 (毫秒).即 delta(use)/delta(rio+wio)

%util:一秒中有百分之多少的時間用于 I/O 操作,或者說一秒中有多少時間 I/O 隊列是非空的.即 delta(use)/s/1000 (因為use的單位為毫秒)

如果%util 接近 100%,說明產生的I/O請求太多,I/O系統(tǒng)已經滿負荷,該磁盤可能存在瓶頸.

如果idle小于70% IO壓力就較大了,一般讀取速度有較多的wait

avgqu-sz 是需要注意的地方,這個就是直接每次操作的數據的大小,如果次數多,但數據小的話,其實 IO 也會很小.如果數據大,才IO 的數據會高,通過 avgqu-sz × ( r/s or w/s ) = rsec/s or wsec/s

CPU Utilization Report

[root@localhost ~]# iostat -c 1 10

Linux 2.6.32-431.11.2.el6.x86_64 (localhost)? ? ? ? 01/08/2016? ? ? _x86_64_? ? ? ? (4 CPU)

avg-cpu:? %user? %nice %system %iowait? %steal? %idle

5.09? ? 0.00? ? 2.08? ? 4.28? ? 0.00? 88.55

avg-cpu:? %user? %nice %system %iowait? %steal? %idle

1.75? ? 0.00? ? 0.50? ? 0.00? ? 0.00? 97.75

avg-cpu:? %user? %nice %system %iowait? %steal? %idle

1.50? ? 0.00? ? 0.50? ? 0.00? ? 0.00? 98.00

avg-cpu:? %user? %nice %system %iowait? %steal? %idle

0.25? ? 0.00? ? 0.25? ? 0.00? ? 0.00? 99.50

參數說明

%user:CPU處在用戶模式下的時間百分比

%nice:CPU處在帶NICE值的用戶模式下的時間百分比

%system:CPU處在系統(tǒng)模式下的時間百分比

%iowait:CPU等待輸入輸出完成時間的百分比

%steal:管理程序維護另一個虛擬處理器時,虛擬CPU的無意識等待時間百分比

%idle:CPU空閑時間百分比

如果%iowait的值過高,表示硬盤存在I/O瓶頸,%idle值高,表示CPU較空閑

如果%idle值高但系統(tǒng)響應慢時,有可能是CPU等待分配內存,此時應加大內存容量,%idle值如果持續(xù)低于10,那么系統(tǒng)的CPU處理能力相對較低,表明系統(tǒng)中最需要解決的資源是CPU

常見用法

iostat -d -k 1 10? ? ? ? #查看TPS和吞吐量信息

iostat -d -x -k 1 10? ? ? #查看設備使用率(%util)、響應時間(await)

iostat -c 1 10? ? ? ? ? ? #查看cpu狀態(tài)

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的linux i o的使用情况,Linux下使用iostat 监视I/O状态的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 久草99| 一级一片免费看 | 曰本黄色片 | 日韩黄视频 | 好男人www社区在线视频夜恋 | 一区二区三区在线免费视频 | 亚洲精品久久 | 欧美日韩亚洲系列 | 黄色网页在线看 | 爱爱视频网站 | 色婷婷777777仙踪林 | 少妇人妻综合久久中文字幕 | 欧美在线播放视频 | 欧美日韩不卡一区 | 中文字幕一区二区三区不卡 | 91成人免费在线视频 | 久久免费国产 | 亚洲性综合网 | 制服丝袜一区在线 | 日韩美女视频一区二区 | 国产又色又爽又黄的 | 日本吃奶摸下激烈网站动漫 | 一区二区视频免费在线观看 | 善良的少妇伦理bd中字 | 日韩一级在线 | 欧美不卡在线观看 | 亚洲精品aaaaa | av在观看| 亚洲天堂av一区二区三区 | 性生交生活影碟片 | 国产又粗又爽视频 | 色呦呦视频 | 国产 xxxx| 午夜av导航 | 蜜臀av在线免费观看 | 久久久99精品国产一区二区三区 | 日本在线观看中文字幕 | 天天做天天躁天天躁 | 亚洲激情婷婷 | 国产永久精品大片wwwapp | 在线爽 | 欧美久久久久久又粗又大 | 鲁鲁狠狠狠7777一区二区 | 午夜影院试看 | www.chengren | 欧美日韩二区三区 | 欧美v亚洲| 欧美视频第一区 | 在线亚洲观看 | 国产av日韩一区二区三区精品 | 伊人精品视频 | 久久视 | 成人av资源站 | 麻豆啪啪| 人妻少妇精品无码专区二区 | 亚洲av午夜精品一区二区三区 | 中文字幕一区二区三区久久久 | 素人女裸体 | 日韩小视频在线观看 | www.精品在线 | 日本三级免费 | 4438x全国最大成人网 | 久久精品免费一区二区 | 黄色网页网站 | 日韩视频专区 | 一道本在线观看视频 | 日韩高清免费观看 | 特黄1级潘金莲 | 在线只有精品 | 亚洲国产精品国自产拍久久 | 欧美亚洲大片 | 亚洲综合色站 | 欧美性www| 日韩在线观看视频一区二区三区 | 成人a级片| 日本激情久久 | 男男做爰猛烈啪啪高 | 97精品人妻麻豆一区二区 | 一区二区高清 | 国产农村妇女精品久久久 | 激情图片网站 | 日韩不卡视频在线观看 | n0659极腔濑亚美莉在线播放播放 | 97夜夜操| 日本乱论视频 | 喷水av| 亚洲欧美另类在线视频 | 97超碰人 | 日韩精品高清在线 | 在线免费观看av不卡 | 男女曰逼视频 | 在线视频中文 | 国产福利电影在线 | 国产主播喷水 | 麻豆国产视频 | 人人人射| 国产人妻人伦精品1国产 | av资源免费观看 | 日韩三级av|