|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
在这里你会学到更多的知识,学习linux,更要学习一种geek的精神,python之禅中也说过:以总结分享为荣,以跪求其解为耻;
Linux2.6内核版本后,在proc文件体系中,到场了存进磁盘IO会见数据的文件diskstats,检察文件就能够取得某一时候的累计会见值.$cat/proc/diskstats
……
80sda1307671204781992848404253865895766…
81sda158740159896204009696
82sda2403132632496450214236939485273723…
83sda314232614030865538334302764…
84sda410230000033
85sda557717830420835941525772023051…
86sda63283617126914185361965077…
87sda7311062134816400000121164
88sda863475106711704463645571050986…
89sda94091423445421415796162614979…
810sda1030352166813000000125130
…… 在实践的编程中,有两个成绩要处置,一个是怎样找出磁盘,并将分区过滤失落,由于Linux会同步更新磁盘分区及磁盘的数据,假如不加辨别,数据就会禁绝确,这个能够通第2列落第3列加以辨别,第二列为16的倍数的暗示是磁盘而非分区,第三列是磁盘名字,一样平常的体系中磁盘都是小写的sd开首的.关于一般的scsi磁盘,只需找出第二列是16的倍数,而且第三列前两个字母是”sd”的,就暗示是真实的磁盘,好比后面的数据中,只能取第一行.为何是16的倍数,估量和一块盘最多有16个分区有关吧.
磁盘中,第四列后的都是功能数据,各列的官方注释以下.Field1—#ofreadscompleted
Thisisthetotalnumberofreadscompletedsuccessfully.
Field2—#ofreadsmerged,field6—#ofwritesmerged
Readsandwriteswhichareadjacenttoeachothermaybemergedfor
efficiency.Thustwo4Kreadsmaybecomeone8Kreadbeforeitis
ultimatelyhandedtothedisk,andsoitwillbecounted(andqueued)
asonlyoneI/O.Thisfieldletsyouknowhowoftenthiswasdone.
Field3—#ofsectorsread
Thisisthetotalnumberofsectorsreadsuccessfully.
Field4—#ofmillisecondsspentreading
Thisisthetotalnumberofmillisecondsspentbyallreads(as
measuredfrom__make_request()toend_that_request_last()).
Field5—#ofwritescompleted
Thisisthetotalnumberofwritescompletedsuccessfully.
Field7—#ofsectorswritten
Thisisthetotalnumberofsectorswrittensuccessfully.
Field8—#ofmillisecondsspentwriting
Thisisthetotalnumberofmillisecondsspentbyallwrites(as
measuredfrom__make_request()toend_that_request_last()).
Field9—#ofI/Oscurrentlyinprogress
Theonlyfieldthatshouldgotozero.Incrementedasrequestsare
giventoappropriatestructrequest_queueanddecrementedastheyfinish.
Field10—#ofmillisecondsspentdoingI/Os
Thisfieldisincreasessolongasfield9isnonzero.
Field11—weighted#ofmillisecondsspentdoingI/Os
ThisfieldisincrementedateachI/Ostart,I/Ocompletion,I/O
merge,orreadofthesestatsbythenumberofI/Osinprogress
(field9)timesthenumberofmillisecondsspentdoingI/Osincethe
lastupdateofthisfield.Thiscanprovideaneasymeasureofboth
I/Ocompletiontimeandthebacklogthatmaybeaccumulating. 另外一个成绩,当Linux接到存贮时,大概会有多条通路,构成良多的虚盘,这时候不克不及取虚盘的功能数据,好比连到EMC的存贮时,第三列的名字应该为emcpower开首,而不是sd开首了.在Linuxmon程序中,能够经由过程disk参数,指定磁盘的前缀名字.$linuxmon.bindisk=emcpower
…ReadRTimWritWTimBusyTime
…700570039
…650550040
…100016200112
…700570036
…650700064
…760550033
…1052980074
…650540038
…15501020085
…760630049
…640540038
…530340022 假如下面的了解有成绩,接待指出来,正在进修当中,有了解毛病也是不免的.
来自:http://www.anysql.net/dba/get-linux-iostat.html
网络操作命令:ifconfig、ip、ping、netstat、telnet、ftp、route、rloginrcp、finger、mail、nslookup |
|