¼Ç¼һ´Î¶¨Î»ÏµÍ³»ºÂýµÄ¹ý³Ì(LinuxÏÂÈçºÎ¼àÊÓÓ²ÅÌ)
×î½üÓÐһ̨·þÎñÆ÷µÄµÄÏìÓ¦ºÜÂý£¬²é¿´ÁËһϷ¢ÏÖÄÚ´æºÍCPUʹÓö¼»¹ÐУ¬Ê¹ÓÃiostat²é¿´Ó²ÅÌi/oʱ£¬·¢ÏÖÿÃëÄÚÓÃÓÚÓ²ÅÌi/o²Ù×÷µÄ¾¹È»½üºõ100%¡£È»ºóÅäºÏiotop¶¨Î»µ½ÔÀ´ÊÇÒòΪmysqlµ¼Öµģ¬¼Ì¶ø·¢ÏÖÊÇÒòΪÊý¾Ý¿âÖеÄÒ»ÕűíûÓÐ×öÓÅ»¯£¬µ¼ÖÂËø±íµÄÏÖÏó£¬ÕÒµ½ÔÒò¾ÍºÜ¿ìµÄ°ÑÎÊÌâ½â¾öÁË¡£
1£®ÃüÁî¸ñʽ£º
iostat[²ÎÊý][ʱ¼ä][´ÎÊý]
2£®ÃüÁÄÜ£º
ͨ¹ýiostat·½±ã²é¿´CPU¡¢Íø¿¨¡¢ttyÉ豸¡¢´ÅÅÌ¡¢CD-ROM µÈµÈÉ豸µÄ»î¶¯Çé¿ö,¸ºÔØÐÅÏ¢¡£
3£®ÃüÁî²ÎÊý£º
-C ÏÔʾCPUʹÓÃÇé¿ö
-d ÏÔʾ´ÅÅÌʹÓÃÇé¿ö
-k ÒÔ KB Ϊµ¥Î»ÏÔʾ
-m ÒÔ M Ϊµ¥Î»ÏÔʾ
-N ÏÔʾ´ÅÅÌÕóÁÐ(LVM) ÐÅÏ¢
-n ÏÔʾNFS ʹÓÃÇé¿ö
-p[´ÅÅÌ] ÏÔʾ´ÅÅ̺ͷÖÇøµÄÇé¿ö
-t ÏÔʾÖն˺ÍCPUµÄÐÅÏ¢
-x ÏÔʾÏêϸÐÅÏ¢
-V ÏÔʾ°æ±¾ÐÅÏ¢
4 . ÃüÁî·µ»ØÐÅÏ¢²ÎÊý½âÊÍ£º
a¡¢cpuÊôÐÔֵ˵Ã÷£º
%user£ºCPU´¦ÔÚÓû§Ä£Ê½ÏµÄʱ¼ä°Ù·Ö±È¡£
%nice£ºCPU´¦ÔÚ´øNICEÖµµÄÓû§Ä£Ê½ÏµÄʱ¼ä°Ù·Ö±È¡£
%system£ºCPU´¦ÔÚϵͳģʽϵÄʱ¼ä°Ù·Ö±È¡£
%iowait£ºCPUµÈ´ýÊäÈëÊä³öÍê³Éʱ¼äµÄ°Ù·Ö±È¡£
%steal£º¹ÜÀí³ÌÐòά»¤ÁíÒ»¸öÐéÄâ´¦ÀíÆ÷ʱ£¬ÐéÄâCPUµÄÎÞÒâʶµÈ´ýʱ¼ä°Ù·Ö±È¡£
%idle£ºCPU¿ÕÏÐʱ¼ä°Ù·Ö±È¡£
±¸×¢£ºÈç¹û%iowaitµÄÖµ¹ý¸ß£¬±íʾӲÅÌ´æÔÚI/OÆ¿¾±£¬%idleÖµ¸ß£¬±íʾCPU½Ï¿Õ ÏУ¬Èç¹û%idleÖµ¸ßµ«ÏµÍ³ÏìÓ¦Âýʱ£¬ÓпÉÄÜÊÇCPUµÈ´ý·ÖÅäÄڴ棬´ËʱӦ¼Ó´óÄÚ´æÈÝ Á¿¡£%idleÖµÈç¹û³ÖÐøµÍÓÚ10£¬ÄÇôϵͳµÄCPU´¦ÀíÄÜÁ¦Ïà¶Ô½ÏµÍ£¬±íÃ÷ϵͳÖÐ×îÐèÒª ½â¾öµÄ×ÊÔ´ÊÇCPU¡£
b¡¢diskÊôÐÔֵ˵Ã÷£º
rrqm/s: ÿÃë½øÐÐ merge µÄ¶Á²Ù×÷ÊýÄ¿¡£¼´ rmerge/s
wrqm/s: ÿÃë½øÐÐ merge µÄд²Ù×÷ÊýÄ¿¡£¼´ wmerge/s
r/s: ÿÃëÍê³ÉµÄ¶Á I/O É豸´ÎÊý¡£¼´ rio/s
w/s: ÿÃëÍê³ÉµÄд I/O É豸´ÎÊý¡£¼´ wio/s
rsec/s: ÿÃë¶ÁÉÈÇøÊý¡£¼´ rsect/s
wsec/s: ÿÃëдÉÈÇøÊý¡£¼´ wsect/s
rkB/s: ÿÃë¶ÁK×Ö½ÚÊý¡£ÊÇ rsect/s µÄÒ»°ë£¬ÒòΪÿÉÈÇø´óСΪ512×Ö½Ú¡£
wkB/s: ÿÃëдK×Ö½ÚÊý¡£ÊÇ wsect/s µÄÒ»°ë¡£
avgrq-sz: ƽ¾ùÿ´ÎÉ豸I/O²Ù×÷µÄÊý¾Ý´óС (ÉÈÇø)¡£
avgqu-sz: ƽ¾ùI/O¶ÓÁг¤¶È¡£
await: ƽ¾ùÿ´ÎÉ豸I/O²Ù×÷µÄµÈ´ýʱ¼ä (ºÁÃë)¡£
svctm: ƽ¾ùÿ´ÎÉ豸I/O²Ù×÷µÄ·þÎñʱ¼ä (ºÁÃë)¡£
%util: Ò»ÃëÖÐÓаٷÖÖ®¶àÉÙµÄʱ¼äÓÃÓÚ I/O ²Ù×÷£¬¼´±»ioÏûºÄµÄcpu°Ù·Ö±È
±¸×¢£ºÈç¹û %util ½Ó½ü 100%£¬ËµÃ÷²úÉúµÄI/OÇëÇóÌ«¶à£¬I/OϵͳÒѾÂú¸ººÉ£¬¸Ã ´ÅÅÌ¿ÉÄÜ´æÔÚÆ¿¾±¡£Èç¹û svctm ±È½Ï½Ó½ü await£¬ËµÃ÷ I/O ¼¸ºõûÓеȴýʱ¼ä£»Èç¹û await Ô¶´óÓÚ svctm£¬ËµÃ÷I/O ¶ÓÁÐÌ«³¤£¬ioÏìӦ̫Âý£¬ÔòÐèÒª½øÐбØÒªÓÅ»¯¡£Èç¹û avgqu-sz±È½Ï´ó£¬Ò²±íʾÓе±Á¿ioÔڵȴý¡£
¶þ¡¢iotopÃüÁî
iotopÃüÁîÊÇרÃÅÏÔʾӲÅÌIOµÄÃüÁ½çÃæ·ç¸ñÀàËÆtopÃüÁî¡£Õâ¸öÃüÁîÖ»ÓÐÔÚkernelv2.6.20¼°ÒÔºóµÄ°æ±¾ÖвÅÓС£
1¡¢ÔÚRed Hat »òCentOSϵͳÖа²×°
yum -y install iotop*
2¡¢¾ßÌåµÄʹÓÃ
¿ÉÒÔÓÃ×óÓÒ¼ýÍ·²Ù×÷£¬°´ r ÊÇÏà·´·½Ïò£¬°´ o ÊǶ¯Ì¬Çл»Ó÷¨ iotop -²ÎÊý
¨Cversion ²é¿´°æ±¾ÐÅÏ¢µÄ
-h, ¨Chelp ²é¿´°ïÖúÐÅÏ¢µÄ
-o, ¨Conly Ö»ÏÔʾÔÚ»®Ó²Å̵ijÌÐò
-b, ¨Cbatch ÅúÁ¿´¦Àí ÓÃÀ´¼Ç¼ÈÕÖ¾µÄ
-n NUM É趨ѻ·¼¸´Î
-d SEC, ¨Cdelay=SEC É趨ÏÔʾʱ¼ä¼ä¸ô
ÁíÍ⣬Èç¹ûlinuxϵͳÄں˰汾̫µÍÁË£¬×îºóiotopÃüÁîµÄʹÓÃÖ»ÄÜ¿´µ½´ÅÅ̶ÁȡЊϢ£¬¸÷Àà½ø³ÌÏûºÄ×ÊÔ´µÄÏêϸÐÅÏ¢ÎÞ·¨²é¿´¡£
ÍƼöÐÅÏ¢
- 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µÈ
ÆÀÂÛ