[root@20081006-1724 ~]# iostat -x
Linux 2.6.9-78.ELsmp (20081006-1724) 11/20/2009
avg-cpu: %user %nice %sys %iowait %idle
0.19 0.00 0.04 0.03 99.73
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util
sda 0.05 17.60 1.46 7.72 80.69 202.57 40.34 101.29 30.87 0.01 1.06 0.37 0.34
sda1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 29.90 0.00 3.14 3.14 0.00
sda2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 16.25 0.00 1.51 1.30 0.00
sda3 0.05 17.60 1.46 7.72 80.69 202.57 40.34 101.29 30.87 0.01 1.06 0.37 0.34
dm-0 0.00 0.00 1.46 25.28 80.32 202.26 40.16 101.13 10.57 0.36 13.56 0.13 0.34
dm-1 0.00 0.00 0.05 0.04 0.37 0.32 0.18 0.16 8.00 0.00 6.84 1.30 0.01
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: ÿÃë¶ÁÉÈÇøÊý¡£¼´ delta(rsect)/s
wsec/s: ÿÃëдÉÈÇøÊý¡£¼´ delta(wsect)/s
rkB/s: ÿÃë¶ÁK×Ö½ÚÊý¡£ÊÇ rsect/s µÄÒ»°ë£¬ÒòΪÿÉÈÇø´óСΪ512×Ö½Ú¡£
wkB/s: ÿÃëдK×Ö½ÚÊý¡£ÊÇ wsect/s µÄÒ»°ë¡£
avgrq-sz: ƽ¾ùÿ´ÎÉ豸I/O²Ù×÷µÄÊý¾Ý´óС (ÉÈÇø)¡£¼´ 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ϵͳÒѾÂú¸ººÉ£¬¸Ã´ÅÅÌ
¿ÉÄÜ´æÔÚÆ¿¾±¡£
±È½ÏÖØÒªµÄ²ÎÊý
%util: Ò»ÃëÖÐÓаٷÖÖ®¶àÉÙµÄʱ¼äÓÃÓÚ I/O ²Ù×÷£¬»òÕß˵һÃëÖÐÓжàÉÙʱ¼ä I/O ¶ÓÁÐÊÇ·Ç¿ÕµÄ
svctm: ƽ¾ùÿ´ÎÉ豸I/O²Ù×÷µÄ·þÎñʱ¼ä
await: ƽ¾ùÿ´ÎÉ豸I/O²Ù×÷µÄµÈ´ýʱ¼ä
avgqu-sz: ƽ¾ùI/O¶ÓÁ㤶È
Èç
¹û%util½Ó½ü100%,±íÃ÷i/oÇëÇóÌ«¶à,i/oϵͳÒѾÂú¸ººÉ,´ÅÅÌ¿ÉÄÜ´æÔÚÆ¿¾±,Ò»°ã%util´óÓÚ70%,i/oѹÁ¦¾Í±È½Ï´ó,¶ÁÈ¡ËÙ¶ÈÓнÏ
¶àµÄwait.ͬʱ¿ÉÒÔ½áºÏvmstat²é¿´²é¿´b²ÎÊý(µÈ´ý×ÊÔ´µÄ½ø³ÌÊý)ºÍwa²ÎÊý(IOµÈ´ýËùÕ¼ÓõÄCPUʱ¼äµÄ°Ù·Ö±È,¸ß¹ý30%ʱIOѹÁ¦
¸ß)¡£
await µÄ´óСһ°ãÈ¡¾öÓÚ·þÎñʱ¼ä(svctm) ÒÔ¼° I/O ¶ÓÁеij¤¶ÈºÍ I/O ÇëÇóµÄ·¢³öģʽ¡£Èç¹û svctm ±È½Ï½Ó½ü
await£¬ËµÃ÷ I/O ¼¸ºõûÓеȴýʱ¼ä£»Èç¹û await Ô¶´óÓÚ svctm£¬ËµÃ÷ I/O ¶ÓÁÐÌ«³¤£¬Ó¦Óõõ½µÄÏìӦʱ¼ä±äÂý¡£
ÐÎÏóµÄ±ÈÓ÷
r/s+w/s ÀàËÆÓÚ½»¿îÈ˵Ä×ÜÊý
ƽ¾ù¶ÓÁ㤶È(avgqu-sz)ÀàËÆÓÚµ¥Î»Ê±¼äÀïƽ¾ùÅŶÓÈ˵ĸöÊý
ƽ¾ù·þÎñʱ¼ä(svctm)ÀàËÆÓÚÊÕÒøÔ±µÄÊÕ¿îËÙ¶È
ƽ¾ùµÈ´ýʱ¼ä(await)ÀàËÆÓÚƽ¾ùÿÈ˵ĵȴýʱ¼ä
ƽ¾ùI/OÊý¾Ý(avgrq-sz)ÀàËÆÓÚƽ¾ùÿÈËËùÂòµÄ¶«Î÷¶àÉÙ
I/O ²Ù×÷ÂÊ (%util)ÀàËÆÓÚÊÕ¿į̂ǰÓÐÈËÅŶӵÄʱ¼ä±ÈÀý
É豸IO²Ù×÷:×ÜIO(io)/s = r/s(¶Á) +w/s(д) =1.46 + 25.28=26.74
ƽ¾ùÿ´ÎÉ豸I/O²Ù×÷Ö»ÐèÒª0.36ºÁÃëÍê³É,ÏÖÔÚÈ´ÐèÒª10.57ºÁÃëÍê³É£¬ÒòΪ·¢³öµÄÇëÇóÌ«¶à(ÿÃë26.74¸ö)£¬¼ÙÈçÇëÇóʱͬʱ·¢³öµÄ£¬¿ÉÒÔÕâÑù¼ÆËãƽ¾ùµÈ´ýʱ¼ä:
ƽ¾ùµÈ´ýʱ¼ä=µ¥¸öI/O·þÎñÆ÷ʱ¼ä*(1+2+...+ÇëÇó×ÜÊý-1)/ÇëÇó×ÜÊý
ÿÃë·¢³öµÄI/0ÇëÇóºÜ¶à,µ«ÊÇƽ¾ù¶ÓÁоÍ4,±íʾÕâЩÇëÇó±È½Ï¾ùÔÈ,´ó²¿·Ö´¦Àí»¹ÊDZȽϼ°Ê±
svctm Ò»°ãҪСÓÚ await (ÒòΪͬʱµÈ´ýµÄÇëÇóµÄµÈ´ýʱ¼ä±»Öظ´¼ÆËãÁË)£¬
svctm µÄ´óСһ°ãºÍ´ÅÅÌÐÔÄÜÓйأ¬CPU/ÄÚ´æµÄ¸ººÉÒ²»á¶ÔÆäÓÐÓ°Ï죬ÇëÇó¹ý¶à
Ò²»á¼ä½Óµ¼Ö svctm µÄÔö¼Ó¡£await µÄ´óСһ°ãÈ¡¾öÓÚ·þÎñʱ¼ä(svctm) ÒÔ¼°
I/O ¶ÓÁеij¤¶ÈºÍ I/O ÇëÇóµÄ·¢³öģʽ¡£Èç¹û svctm ±È½Ï½Ó½ü await£¬ËµÃ÷
I/O ¼¸ºõûÓеȴýʱ¼ä£»Èç¹û await Ô¶´óÓÚ svctm£¬ËµÃ÷ I/O ¶ÓÁÐÌ«³¤£¬Ó¦ÓÃ
µÃµ½µÄÏìӦʱ¼ä±äÂý£¬Èç¹ûÏìӦʱ¼ä³¬¹ýÁËÓû§¿ÉÒÔÈÝÐíµÄ·¶Î§£¬Õâʱ¿ÉÒÔ¿¼ÂÇ
¸ü»»¸ü¿ìµÄ´ÅÅÌ£¬µ÷ÕûÄÚºË elevator Ëã·¨£¬ÓÅ»¯Ó¦Ó㬻òÕßÉý¼¶ CPU¡£
¶ÓÁ㤶È(avgqu-sz)Ò²¿É×÷ΪºâÁ¿ÏµÍ³ I/O ¸ººÉµÄÖ¸±ê£¬µ«ÓÉÓÚ avgqu-sz ÊÇ
°´ÕÕµ¥Î»Ê±¼äµÄƽ¾ùÖµ£¬ËùÒÔ²»ÄÜ·´Ó³Ë²¼äµÄ I/O ºéË®¡£
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ