当前位置: 首页 > >

LinuxϵͳÏÂJava³ÌÐòµÄ»ù±¾¼à¿Ø

发布时间:

LinuxϵͳÏÂJava³ÌÐòµÄ¼à¿Ø


µ±Ò»¸ö³ÌÐò²¿Êðµ½linuxϵͳÖк󣬳ýÁËÎÒÃdz£Óõĵ¥Ôª²âÊÔ£¬ÏµÍ³²âÊÔÀ´È·±£ÏµÍ³ÕýÈ·ÔËÐÐÖ®Í⣬ÎÒÃÇ»¹ÐèҪһЩÓÐЧµÄ·½Ê½Äܹ»ÊµÊ±¼à¿ØϵͳÔËÐеÄ״̬£¬¼°Ê±µÄ·¢ÏÖ¿ÉÄܳöÏÖµÄÎÊÌ⣬ÏÂÎÄÖÐ×ܽáÁ˸öÈ˳£ÓõÄһЩϵͳÃüÁî¡£


?


½ø³Ì¼à¿ØÁ÷³ÌÈçÏ£º


»ñÈ¡½ø³ÌµÄPID


1.??????PSÃüÁî


PSÃüÁ¸æϵͳµ±Ç°ËùÓÐÏ̵߳ÄÒ»¸ö¾µÏñ¡£³£ÓÃÑ¡ÏîΪ£º


-e |? -a :ÏÔʾËùÓÐÏß³Ì


-u: °´Óû§ÃûºÍÆô¶¯Ê±¼äÀ´ÏÔʾ½ø³Ì


-x: ÏÔʾÎÞ¿ØÖÆÖն˵Ľø³Ì


-f:°´Ê÷×´¸ñʽÀ´ÏÔʾÏß³Ì


ÕâÀïÖ»ÊÇʹÓÃpsµÄÒ»¸ö¼òµ¥Ó÷¨À´»ñÈ¡pid £º


ps ?ef


Êä³öÄÚÈÝΪ£º


UID??????? PID?PPID? C STIME TTY????????? TIME CMD


±ÈÈçÎÒÃDz鿴hadoop namenode½ø³ÌµÄ½á¹ûÈçÏ£º



ÕâÀï¿´µ½ÁË3¸öÊä³ö½á¹û£¬ÒÀ´ÎÊÇnamenode,SecondaryNamenode,grep


µ±È»ÎÒÃǸÐÐËȤµÄÊÇnamenode ,ËùÓÐpidÊÇ2113


?


»ñÈ¡ÁËPIDºó£¬ÎÒÃǾͿÉÒԶԸýø³ÌµÄÏêϸÐÅÏ¢¾ÍÐзÖÎöÁË£º


l? ½ø³ÌÄÚ´æʹÓÃÇé¿ö


Top ÃüÁ


±¾ÈË»úÆ÷ĬÈÏÊä³ö£º


PID USER????? PR? NI?VIRT? RES? SHR S %CPU %MEM??? TIME+?COMMAND


ÆäÖкÍÄÚ´æÏà¹ØµÄÑ¡ÏîΪ£º


%MEM: ½ø³ÌʹÓõÄÎïÀíÄÚ´æ°Ù·Ö±È


VIRT:½ø³ÌʹÓõÄÐéÄâÄÚ´æ×ÜÁ¿


RES:½ø³ÌÊÇÓõģ¬Î´±»»»³öµÄÎïÀíÄÚ´æ´óС


?


TopÃüÁî×îÖ÷ÒªµÄϵͳ¼à¿ØÃüÁÕû¸ö·þÎñÆ÷µÄÏêϸ״̬¶¼¿ÉÒÔÔÚ´Ë»ñÈ¡£¬Ä¬ÈÏÑ¡ÏîÖÐÒѾ­¿ÉÒÔÂú×ãÈÕ³£Ê¹ÓÃÁË£¬ÔÚtopÊä³ö½çÃæÉ*´f ¿ÉÒÔ½øÈëÏÔʾÏîµÄÑ¡Ôñ½çÃ棬¿ÉÒÔ×Ô¶¨ÒåÊä³öµÄÑ¡Ïî¡£ÔÚÕâ¸ö½çÃæÏÂÐèҪѡÔñʲôѡÏîÔñ°´¶ÔÓ¦×Ö·ûÔò¿É£¬Èçp¶ÔÓ¦SWAP£¬±ê*ºÅλµ±Ç°ÏÔʾµÄ¡£



?


?


ͨ¹ýtopµÄ¹Û²ì»ñÈ¡hadoop namenode½ø³Ì£¨½ø³ÌºÅ2113£©µÄÄÚ´æʹÓÃÇé¿ö



l? ½ø³ÌµÄCPU×´¿ö£¬Í¬Ñù´ÓtopÃüÁîµÄÊä³ö»ñÈ¡¡£


?


²é¿´½ø³ÌÍøÂç¶Ë¿ÚµÄ´ò¿ªÇé¿ö


NetstatÃüÁ³£ÓÃÑ¡ÏîΪ£º


-a ÏÔʾËùÓУ¬Ä¬Èϲ»ÏÔʾLISTENÏà¹Ø


-u ½öÏÔʾudpÏà¹Ø


-t? ½öÏÔʾtcpÏà¹Ø


-l? ½öÁгöListenµÄ·þÎñ


-p ÏÔʾÏà¹ØµÄ³ÌÐò



?


Èç¹ûÎÒÃÇÈ·¶¨µÄÊÇijһ¸ö¶Ë¿ÚµÄÇé¿öµÄ»°£¬¿ÉÒÔ¼òµ¥µÄnetstat ?a | grep ¼´¿É


?


ÕâÀïÖ÷ÒªÊÇҪʹÓÃ-pÑ¡Ï½ø³ÌÏà¹ØµÄÁ¬½Ó¶¼ÏÔʾ³öÀ´£¬ÅжϽø³ÌµÄ¶Ë¿ÚʹÓÃÇé¿öÓÐûÓÐÒì³££ºnetstat ?ap | grep 2113


ÏÔʾÁËnamenode ½ø³ÌµÄÍøÂçÁ¬½ÓÇé¿ö



?


ͨ¹ý¼ì²éÄڴ棬CPUºÍÍøÂç×´¿öÒ²¾ÍÄÜ¿´³öÒ»¸ö½ø³ÌµÄ½¡¿µ×´Ì¬ÁË£¬Èç¹û³öÏÖÒì³££¬ÎÒÃÇÐèÒª½ÓÏÂÀ´Õë¶ÔJava³ÌÐòµÄÃüÁîÊǽøÒ»²½·ÖÎöjavaÓ¦ÓõÄÔËÐÐÇé¿ö¡£


l? ÄÚ´æ


Jmap ¸ÃÃüÁîÄÜ´òÓ¡Java½ø³ÌÖжԵÄÅäÖã¬ÊµÓÃÇé¿ö£¬¶ÔÏóÐÅÏ¢¡£


Jmap ?heap 2113 //´òÓ¡namenode½ø³ÌµÄ¶ÓÅäÖúÍʹÓÃÇé¿ö




¿ÉÒÔ¿´µ½¶ÓµÄ·ÖÅäºÍÐÂÉú´ú£¬ÀÏÉú´úµÈ·ÖÇøµÄʹÓÃÇé¿ö


?




ÎÒ×î³£ÓõÄÊÇ-histo:live Ñ¡Ï¸ÃÑ¡Ïî»á´òÓ¡µ±Ç°µÄ»îÔ¾¶ÔÏ󣬿ÉÒÔ¼ì²éÄÚ´æÖÐÊÇ·ñ´æÔÚÒì³£ÊýÁ¿µÄ¶ÔÏó¡£



¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£





×îºó»áͳ¼Æ¶ÔÏóµÄ¸öÊý£¬Õ¼ÓõĿռ䡣


½áºÏ³ÖÐø¹Û²ìtopÃüÁ·¢ÏÖÄÚ´æµÄʹÓÃÔÚ³ÖÐøÔö³¤»òÕ߾Ӹ߲»ÏµÄÇé¿öÏÂʹÓÃjmap¿ÉÒԲ鿴µ½¾¿¾¹ÊÇʲô¶ÔÏóÕ¼ÓÃÁË´óÁ¿¿Õ¼ä£¬»òÕߵò»µ½ÕýÈ·µÄÊÍ·Å¡£


?


l? JVMÏß³Ì


JstackÃüÁî


¸ÃÃüÁî¿ÉÒÔ´òÓ¡³öJava³ÌÐòµ±Ç°µÄÏß³ÌÕ»µÄÐÅÏ¢¡£





¡£¡£¡£¡£¡£¡£¡£¡£


?


¿ÉÒÔ×ÜÌå²é¿´ÊÇ·ñÓÐÒì³£µÄỊ̈߳¬»òÕßÊÇʹÓÃһЩ¼òµ¥µÄÃüÁîÀ´½øÐÐͳ¼ÆÏ̸߳öÊý¡£Èç¹û³ÌÐò³öÏÖÒì³£µÄ¶ÂÈû£¬Ò²¿ÉÒÔ´ÓÏ̵߳ÄÕ»ÐÅÏ¢Öв鿴³ö¿ÉÄܵÄ×èÈû²Ù×÷£¬ÉèÖÃÊÇËÀÑ­»·£¨°¡£¡£¡£©¡£


È磺 ͳ¼ÆIPC SERVER HANDLERµÄÏß³ÌÊýÁ¿



?


ÁíÍâÔÙ´ÎÇ¿µ÷ÏÂtopÃüÁîµÄÖØÒªÐÔ£¬ÕâÀïÔÙ°ÑtopÃüÁîµÄÊä³ö½øÐÐÏêϸµÄÃèÊö¡£


top - 19:37:02 up? 1:12,?2 users,? load average: 0.00,0.00, 0.00


Tasks:?97 total,?? 1 running,? 96 sleeping,??0 stopped,?? 0 zombie


Cpu(s):?0.0%us,? 0.0%sy,? 0.0%ni, 89.0%id, 11.0%wa,? 0.0%hi,?0.0%si,? 0.0%st


Mem:??2071588k total,?? 500372kused,? 1571216k free,??? 22912k buffers


Swap:?2064376k total,??????? 0kused,? 2064376k free,?? 169384k cached


?


Load average: ϵͳ¸ºÔØ£¬ÈÎÎñ¶ÓÁеÄ*¾ù³¤¶È£¬Èý¸öÊýÖµ·Ö±ðΪ?1·ÖÖÓ¡¢5·ÖÖÓ¡¢15·ÖÖÓÇ°µ½ÏÖÔÚµÄ*¾ùÖµ¡£ÓÉÊä³ö¿É¼ûµ±Ç°²¢Ã»ÓÐʲôÈÎÎñ£¬Èç¹ûÖµ¹ý¸ßµÄ»°¿ÉÄÜÒª¿¼ÂÇϵͳµÄ³ÐÊÜÄÜÁ¦»ò½øÐÐÀ©Õ¹ÁË¡£


?


Tasks: ½ø³Ì×ÜÊý


1 running ÕýÔÚÔËÐеĽø³ÌÊý


96 sleep ˯ÃߵĽø³ÌÊý


0 stopped Í£Ö¹Êý


0 zombie ½©Ê¬Êý


CPU(s):


0.0%us, Óû§Õ¼±È


?0.0%sy, ÄÚºËÕ¼±È


?0.0%ni, ½ø³Ì¿Õ¼äÄڸıä¹ýÓÅÏȼ¶µÄ½ø³ÌµÄCPUÕ¼±È


89.0%id, ¿ÕÏÐCPUÕ¼±È


11.0%wa, µÈ´ýÊäÈëÊä³öµÄCPUÕ¼±È¡¢ÕâÀï¿ÉÒÔ¿´³öϵͳµÄIOÇé¿ö±È½Ï¸ß


0.0%hi Ó²ÖжÏ,? 0.0%si ÈíÖжÏ,? 0.0%st µÁȡʱ¼ä


Mem:??


2071588k total, ×ÜÎïÀíÄÚ´æ


? 500372k used, ÒÑÓÃÎïÀíÄÚ´æ


?1571216k free, ¿ÕÏÐÄÚ´æ


? 22912k buffers Äں˻º´æ


Swap:?


2064376ktotal,? ½»»»Çø×ÜÁ¿


???? ?0kused,? ʹÓÃ×ÜÁ¿


2064376k free,?? ¿ÕÏÐ×ÜÁ¿


169384k cached? »º³å×ÜÁ¿




相关推荐


友情链接: