ÈçÄÇÀïÖÃLinuxϵͳÖÐƵÈÔ·ºÆðµÄÀú³Ì×ÊÔ´ºÄ¾¡ÎÊÌâ
ÈçÄÇÀïÖÃlinuxϵͳÖÐƵÈÔ·ºÆðµÄÀú³Ì×ÊÔ´ºÄ¾¡ÎÊÌâ
¸ÅÊö£º
LinuxϵͳÏ£¬ÓÐʱ»á·ºÆðÀú³Ì×ÊÔ´ºÄ¾¡µÄÇéÐΣ¬ÈçCPU¸ºÔظߡ¢ÄÚ´æÕ¼Óùý¶àµÈÎÊÌâ¡£ÕâЩÎÊÌâ¿ÉÄܵ¼ÖÂϵͳÐÔÄÜϽµ£¬ÉõÖÁϵͳÍ߽⡣±¾ÎĽ«ÏÈÈÝһЩ½â¾öÀú³Ì×ÊÔ´ºÄ¾¡ÎÊÌâµÄ³£¼ûÒªÁì¡£
Ò»¡¢¶¨Î»ÎÊÌ⣺
¼à²âϵͳ×ÊÔ´£ºÊ¹ÓÃtop¡¢htopµÈ¹¤¾ß¼à²âϵͳ×ÊÔ´µÄʹÓÃÇéÐΣ¬°üÀ¨CPU¡¢ÄÚ´æ¡¢´ÅÅ̺ÍÍøÂçµÈ¡£
Éó²éÀú³Ì£ºÊ¹ÓÃpsÏÂÁîÉó²éÄ¿½ñÔËÐеÄÀú³Ì£¬Æ¾Ö¤CPU¡¢ÄÚ´æ¡¢IOµÈÖ¸±êÅÅÐò£¬ÕÒ³öÏûºÄ×ÊÔ´½Ï¶àµÄÀú³Ì¡£
¼ì²éϵͳÈÕÖ¾£ºÍ¨¹ýÉó²é/var/log/ϵÄÈÕÖ¾Îļþ£¬Èç/var/log/messages¡¢/var/log/syslogµÈÀ´²éÕÒÒì³£ÐÅÏ¢£¬ÈçOOM£¨Out Of Memory£©¹ýʧ¡£
¶þ¡¢´¦ÀíÒªÁ죺
ÓÅ»¯Àú³Ì£º¹ØÓÚÏûºÄ×ÊÔ´½Ï¶àµÄÀú³Ì£¬¿ÉÒÔÓÅ»¯Æä´úÂë»òÉèÖã¬ïÔÌ×ÊÔ´Õ¼Óá£ÀýÈ磬ÓÅ»¯SQLÅÌÎÊ¡¢ÏÞÖƲ¢·¢ÅþÁ¬¡¢µ÷½âÏ̳߳ؾÞϸµÈ¡£
µ÷½â×ÊÔ´·ÖÅÉ£ºÈôÊÇij¸öÀú³ÌÐèÒª¸ü¶àµÄ×ÊÔ´£¬¿ÉÒÔʹÓÃniceÏÂÁî»òtasksetÏÂÁîµ÷½âÆäÓÅÏȼ¶»ò°ó¶¨CPU¡£
ÕûÀí½©Ê¬Àú³Ì£º½©Ê¬Àú³ÌÊÇÖ¸ÒѾ¿¢Êµ«¸¸Àú³ÌûÓÐʵʱ½ÓÄɵÄÀú³Ì£¬¿ÉÒÔͨ¹ýkillÏÂÁîÖÕÖ¹½©Ê¬Àú³Ì¡£
ÔöÌí×ÊÔ´£ºÈôÊÇϵͳ×ÊԴȱ·¦£¬¿ÉÒÔͨ¹ýÔöÌíÓ²¼þ×ÊÔ´£¬ÈçÌí¼ÓÄÚ´æ¡¢À©Õ¹Ó²ÅÌÈÝÁ¿µÈÀ´½â¾ö¡£
ʹÓÃ×ÊÔ´ÏÞÖƹ¤¾ß£ºLinuxÌṩÁËһЩ×ÊÔ´ÏÞÖƹ¤¾ß£¬Èçulimit¡¢cgroupsµÈ£¬¿ÉÒÔÏÞÖÆÀú³ÌµÄ×ÊԴʹÓ㬲¢×èֹ̫¹ýÕ¼ÓÃϵͳ×ÊÔ´¡£
Ôöǿϵͳ¼à¿Ø£ºÊ¹Óüà¿Ø¹¤¾ß£¨ÈçNagios¡¢ZabbixµÈ£©°´ÆÚ¼ì²éϵͳ×ÊÔ´µÄʹÓÃÇéÐΣ¬ÊµÊ±·¢Ã÷²¢´¦Àí×ÊÔ´ºÄ¾¡ÎÊÌâ¡£
Éý¼¶Èí¼þ£ºÓÐЩ×ÊÔ´ºÄ¾¡ÎÊÌâ¿ÉÄÜÊÇÈí¼þµÄbugµ¼Öµģ¬Éý¼¶Èí¼þµ½×îа汾¿ÉÒÔ½â¾öһЩÒÑÖªµÄÎÊÌâ¡£
ÁªÏµ³§ÉÌ»òÉçÇø£ºÈôÊÇÓöµ½ÎÞ·¨½â¾öµÄÎÊÌ⣬¿ÉÒÔÏòÏà¹Ø³§ÉÌ»òÉçÇøÇóÖú£¬×·Çóרҵ֧³Ö¡£
Èý¡¢Ô¤·À²½·¥£º
°´ÆÚά»¤ÏµÍ³£ºÊµÊ±¸üвÙ×÷ϵͳ²¹¶¡ºÍÈí¼þ°æ±¾£¬ÕûÀíÎÞÓõÄÈÕÖ¾»ººÍ´æÎļþ£¬¿ÉÒÔÌáÉýϵͳÐÔÄÜ£¬ïÔÌ×ÊÔ´ºÄ¾¡µÄ¿ÉÄÜÐÔ¡£
ºÏÀíÍýÏë×ÊÔ´£ººÏÀíÉèÖÃÀú³ÌµÄ×ÊÔ´ÏÞÖÆ£¬×èֹij¸öÀú³ÌÌ«¹ýÕ¼ÓÃϵͳ×ÊÔ´¡£ÀýÈ磬ÏÞÖÆÿ¸öÓû§µÄÀú³ÌÊý¡¢ÏÞÖÆÿ¸öÀú³ÌµÄÄÚ´æʹÓÃÁ¿µÈ¡£
¼à¿ØÔ¤¾¯£ºÉèÖüà¿Øϵͳ£¬¼à¿ØÒªº¦Ö¸±ê£¨ÈçCPU¡¢ÄÚ´æ¡¢´ÅÅÌ£©µÄʹÓÃÇéÐΣ¬²¢ÉèÖÃÔ¤¾¯»úÖÆ£¬ÊµÊ±·¢Ã÷²¢½â¾öDZÔÚµÄÎÊÌâ¡£
±¸·ÝºÍ»Ö¸´Õ½ÂÔ£º°´ÆÚ¾ÙÐÐϵͳºÍÊý¾ÝµÄ±¸·Ý£¬ÒÔ·À±¬·¢ÒâÍâÇéÐΣ¬¿ÉÒÔʵʱ»Ö¸´ÏµÍ³¡£
½áÂÛ£º
Àú³Ì×ÊÔ´ºÄ¾¡ÎÊÌâÔÚLinuxϵͳÖÐÊdz£¼ûµÄ£¬½â¾öÕâ¸öÎÊÌâÐèҪ׼ȷ¶¨Î»ÎÊÌâ¡¢½ÓÄÉÊʵ±µÄ´¦ÀíÒªÁ죬²¢ÔÚÔ¤·ÀÉÏ×öºÃÏìÓ¦²½·¥¡£Í¨¹ýÒÔÉÏÒªÁ죬ÎÒÃÇ¿ÉÒÔ¸üºÃµØÓ¦¶ÔÏ¢Õù¾öLinuxϵͳÖÐƵÈÔ·ºÆðµÄÀú³Ì×ÊÔ´ºÄ¾¡ÎÊÌâ¡£
ÒÔÉϾÍÊÇÈçÄÇÀïÖÃLinuxϵͳÖÐƵÈÔ·ºÆðµÄÀú³Ì×ÊÔ´ºÄ¾¡ÎÊÌâµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡