top - 01:06:48 up 1:22, 1 user, load average: 0.06, 0.60, 0.48
Tasks: 29 total, 1 running, 28 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3% us, 1.0% sy, 0.0% ni, 98.7% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 191272k total, 173656k used, 17616k free, 22052k buffers
Swap: 192772k total, 0k used, 192772k free, 123988k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1379 root 16 0 7976 2456 1980 S 0.7 1.3 0:11.03 sshd
14704 root 16 0 2128 980 796 R 0.7 0.5 0:02.72 top
1 root 16 0 1992 632 544 S 0.0 0.3 0:00.90 init
2 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
ͳ¼ÆÐÅÏ¢Çø
Ç°ÎåÐÐÊÇϵͳÕûÌåµÄͳ¼ÆÐÅÏ¢¡£µÚÒ»ÐÐÊÇÈÎÎñ¶ÓÁÐÐÅÏ¢£¬Í¬ uptime ÃüÁîµÄÖ´Ðнá¹û¡£ÆäÄÚÈÝÈçÏ£º
01:06:48 µ±Ç°Ê±¼ä
up 1:22 ϵͳÔËÐÐʱ¼ä£¬¸ñʽΪʱ:·Ö
1 user µ±Ç°µÇ¼Óû§Êý
load average: 0.06, 0.60, 0.48 ϵͳ¸ºÔØ£¬¼´ÈÎÎñ¶ÓÁеÄƽ¾ù³¤¶È¡£
Èý¸öÊýÖµ·Ö±ðΪ 1·ÖÖÓ¡¢5·ÖÖÓ¡¢15·ÖÖÓÇ°µ½ÏÖÔÚµÄƽ¾ùÖµ¡£
µÚ¶þ¡¢ÈýÐÐΪ½ø³ÌºÍCPUµÄÐÅÏ¢¡£µ±Óжà¸öCPUʱ£¬ÕâЩÄÚÈÝ¿ÉÄܻᳬ¹ýÁ½ÐС£ÄÚÈÝÈçÏ£º
Tasks: 29 total ½ø³Ì×ÜÊý
1 running ÕýÔÚÔËÐеĽø³ÌÊý
28 sleeping ˯ÃߵĽø³ÌÊý
0 stopped Í£Ö¹µÄ½ø³ÌÊý
0 zombie ½©Ê¬½ø³ÌÊý
Cpu(s): 0.3% us Óû§¿Õ¼äÕ¼ÓÃCPU°Ù·Ö±È
1.0% sy Äں˿ռäÕ¼ÓÃCPU°Ù·Ö±È
0.0% ni Óû§½ø³Ì¿Õ¼äÄڸıä¹ýÓÅÏȼ¶µÄ½ø³ÌÕ¼ÓÃCPU°Ù·Ö±È
98.7% id ¿ÕÏÐCPU°Ù·Ö±È
0.0% wa µÈ´ýÊäÈëÊä³öµÄCPUʱ¼ä°Ù·Ö±È
0.0% hi
0.0% si
×îºóÁ½ÐÐΪÄÚ´æÐÅÏ¢¡£ÄÚÈÝÈçÏ£º
Mem: 191272k total ÎïÀíÄÚ´æ×ÜÁ¿
173656k used ʹÓõÄÎïÀíÄÚ´æ×ÜÁ¿
17616k free ¿ÕÏÐÄÚ´æ×ÜÁ¿
22052k buffers ÓÃ×÷Äں˻º´æµÄÄÚ´æÁ¿
Swap: 192772k total ½»»»Çø×ÜÁ¿
0k used ʹÓõĽ»»»Çø×ÜÁ¿
192772k free ¿ÕÏн»»»Çø×ÜÁ¿
123988k cached »º³åµÄ½»»»Çø×ÜÁ¿¡£
ÄÚ´æÖеÄÄÚÈݱ»»»³öµ½½»»»Çø£¬¶øºóÓÖ±»»»Èëµ½Äڴ棬µ«Ê¹ÓùýµÄ½»»»ÇøÉÐδ±»¸²¸Ç£¬
¸ÃÊýÖµ¼´ÎªÕâЩÄÚÈÝÒÑ´æÔÚÓÚÄÚ´æÖеĽ»»»ÇøµÄ´óС¡£
ÏàÓ¦µÄÄÚ´æÔٴα»»»³öʱ¿É²»±ØÔÙ¶Ô½»»»ÇøдÈë¡£
½ø³ÌÐÅÏ¢Çø
ͳ¼ÆÐÅÏ¢ÇøÓòµÄÏ·½ÏÔʾÁ˸÷¸ö½ø³ÌµÄÏêϸÐÅÏ¢¡£Ê×ÏÈÀ´ÈÏʶһϸ÷Áеĺ¬Òå¡£
ÐòºÅ ÁÐÃû º¬Òå
a PID ½ø³Ìid
b PPID ¸¸½ø³Ìid
c RUSER Real user name
d UID ½ø³ÌËùÓÐÕßµÄÓû§id
e USER ½ø³ÌËùÓÐÕßµÄÓû§Ãû
f GROUP ½ø³ÌËùÓÐÕßµÄ×éÃû
g TTY Æô¶¯½ø³ÌµÄÖÕ¶ËÃû¡£²»ÊÇ´ÓÖÕ¶ËÆô¶¯µÄ½ø³ÌÔòÏÔʾΪ ?
h PR ÓÅÏȼ¶
i NI niceÖµ¡£¸ºÖµ±íʾ¸ßÓÅÏȼ¶£¬ÕýÖµ±íʾµÍÓÅÏȼ¶
j P ×îºóʹÓõÄCPU£¬½öÔÚ¶àCPU»·¾³ÏÂÓÐÒâÒå
k %CPU Éϴθüе½ÏÖÔÚµÄCPUʱ¼äÕ¼ÓðٷֱÈ
l TIME ½ø³ÌʹÓõÄCPUʱ¼ä×ܼƣ¬µ¥Î»Ãë
m TIME+ ½ø³ÌʹÓõÄCPUʱ¼ä×ܼƣ¬µ¥Î»1/100Ãë
n %MEM ½ø³ÌʹÓõÄÎïÀíÄÚ´æ°Ù·Ö±È
o VIRT ½ø³ÌʹÓõÄÐéÄâÄÚ´æ×ÜÁ¿£¬µ¥Î»kb¡£VIRT=SWAP+RES
p SWAP ½ø³ÌʹÓõÄÐéÄâÄÚ´æÖУ¬±»»»³öµÄ´óС£¬µ¥Î»kb¡£
q RES ½ø³ÌʹÓõġ¢Î´±»»»³öµÄÎïÀíÄÚ´æ´óС£¬µ¥Î»kb¡£RES=CODE+DATA
r CODE ¿ÉÖ´ÐдúÂëÕ¼ÓõÄÎïÀíÄÚ´æ´óС£¬µ¥Î»kb
s DATA ¿ÉÖ´ÐдúÂëÒÔÍâµÄ²¿·Ö(Êý¾Ý¶Î+Õ»)Õ¼ÓõÄÎïÀíÄÚ´æ´óС£¬µ¥Î»kb
t SHR ¹²ÏíÄÚ´æ´óС£¬µ¥Î»kb
u nFLT Ò³Ãæ´íÎó´ÎÊý
v nDRT ×îºóÒ»´ÎдÈëµ½ÏÖÔÚ£¬±»Ð޸ĹýµÄÒ³ÃæÊý¡£
w S ½ø³Ì״̬¡£
D=²»¿ÉÖжϵÄ˯Ãß״̬
R=ÔËÐÐ
S=˯Ãß
T=¸ú×Ù/Í£Ö¹
Z=½©Ê¬½ø³Ì
x COMMAND ÃüÁîÃû/ÃüÁîÐÐ
y WCHAN Èô¸Ã½ø³ÌÔÚ˯Ãߣ¬ÔòÏÔʾ˯ÃßÖеÄϵͳº¯ÊýÃû
z Flags ÈÎÎñ±êÖ¾£¬²Î¿¼ sched.h
ĬÈÏÇé¿öϽöÏÔʾ±È½ÏÖØÒªµÄ PID¡¢USER¡¢PR¡¢NI¡¢VIRT¡¢RES¡¢SHR¡¢S¡¢%CPU¡¢%MEM¡¢TIME+¡¢COMMAND ÁС£¿ÉÒÔͨ¹ýÏÂÃæµÄ¿ì½Ý¼üÀ´¸ü¸ÄÏÔʾÄÚÈÝ¡£
¸ü¸ÄÏÔʾÄÚÈÝ
ͨ¹ý f ¼ü¿ÉÒÔÑ¡ÔñÏÔʾµÄÄÚÈÝ¡£°´ f ¼üÖ®ºó»áÏÔʾÁеÄÁÐ±í£¬°´ a-z ¼´¿ÉÏÔʾ»òÒþ²Ø¶ÔÓ¦µÄÁУ¬×îºó°´»Ø³µ¼üÈ·¶¨¡£
°´ o ¼ü¿ÉÒԸıäÁеÄÏÔʾ˳Ðò¡£°´Ð¡Ð´µÄ a-z ¿ÉÒÔ½«ÏàÓ¦µÄÁÐÏòÓÒÒƶ¯£¬¶ø´óдµÄ A-Z ¿ÉÒÔ½«ÏàÓ¦µÄÁÐÏò×óÒƶ¯¡£×îºó°´»Ø³µ¼üÈ·¶¨¡£
°´´óдµÄ F »ò O ¼ü£¬È»ºó°´ a-z ¿ÉÒÔ½«½ø³Ì°´ÕÕÏàÓ¦µÄÁнøÐÐÅÅÐò¡£¶ø´óдµÄ R ¼ü¿ÉÒÔ½«µ±Ç°µÄÅÅÐòµ¹×ª¡£
ÃüÁîʹÓÃ
1£® ¹¤¾ß£¨ÃüÁÃû³Æ
top
2£®¹¤¾ß£¨ÃüÁ×÷ÓÃ
ÏÔʾϵͳµ±Ç°µÄ½ø³ÌºÍÆäËû×´¿ö£»
topÊÇÒ»¸ö¶¯Ì¬ÏÔʾ¹ý³Ì,¼´¿ÉÒÔͨ¹ýÓû§°´¼üÀ´²»¶Ïˢе±Ç°×´Ì¬.Èç¹ûÔÚǰִ̨ÐиÃÃüÁî,Ëü½«¶Àռǰ̨,Ö±µ½Óû§ÖÕÖ¹¸Ã³ÌÐòΪֹ.
±È½Ï׼ȷµÄ˵,topÃüÁîÌṩÁËʵʱµÄ¶Ôϵͳ´¦ÀíÆ÷µÄ״̬¼àÊÓ.Ëü½«ÏÔʾϵͳÖÐCPU×î¡°Ãô¸Ð¡±µÄÈÎÎñÁбí.¸ÃÃüÁî¿ÉÒÔ°´CPUʹÓÃ.ÄÚ´æʹÓúÍÖ´ÐÐʱ¼ä
¶ÔÈÎÎñ½øÐÐÅÅÐò£»¶øÇÒ¸ÃÃüÁîµÄºÜ¶àÌØÐÔ¶¼¿ÉÒÔͨ¹ý½»»¥Ê½ÃüÁî»òÕßÔÚ¸öÈ˶¨ÖÆÎļþÖнøÐÐÉ趨.
3£®»·¾³ÉèÖÃ
ÔÚLinuxÏÂʹÓá£
4£®Ê¹Ó÷½·¨
4£®1ʹÓøñʽ
top [-] [d] [p] [q] [c] [C] [S] [s] [n]
4£®2²ÎÊý˵Ã÷
d Ö¸¶¨Ã¿Á½´ÎÆÁÄ»ÐÅϢˢÐÂÖ®¼äµÄʱ¼ä¼ä¸ô¡£µ±È»Óû§¿ÉÒÔʹÓÃs½»»¥ÃüÁîÀ´¸Ä±äÖ®¡£
p ͨ¹ýÖ¸¶¨¼à¿Ø½ø³ÌIDÀ´½ö½ö¼à¿Øij¸ö½ø³ÌµÄ״̬¡£
q¸ÃÑ¡ÏʹtopûÓÐÈκÎÑӳٵĽøÐÐˢС£Èç¹ûµ÷ÓóÌÐòÓг¬¼¶Óû§È¨ÏÞ£¬ÄÇôtop½«ÒÔ¾¡¿ÉÄܸߵÄÓÅÏȼ¶ÔËÐС£
S Ö¸¶¨ÀÛ¼Æģʽ
s ʹtopÃüÁîÔÚ°²È«Ä£Ê½ÖÐÔËÐС£Õ⽫ȥ³ý½»»¥ÃüÁîËù´øÀ´µÄDZÔÚΣÏÕ¡£
i ʹtop²»ÏÔʾÈκÎÏÐÖûòÕß½©ËÀ½ø³Ì¡£
c ÏÔʾÕû¸öÃüÁîÐжø²»Ö»ÊÇÏÔʾÃüÁîÃû
4.3ÆäËû
¡¡¡¡ÏÂÃæ½éÉÜÔÚtopÃüÁîÖ´Ðйý³ÌÖпÉÒÔʹÓõÄһЩ½»»¥ÃüÁî¡£´ÓʹÓýǶÈÀ´¿´£¬ÊìÁ·µÄÕÆÎÕÕâЩÃüÁî±ÈÕÆÎÕÑ¡ÏÖØҪһЩ¡£ÕâЩÃüÁÊǵ¥×ÖĸµÄ£¬Èç¹ûÔÚÃüÁîÐÐÑ¡ÏîÖÐʹÓÃÁËsÑ¡ÏÔò¿ÉÄÜÆäÖÐһЩÃüÁî»á±»ÆÁ±Îµô¡£
¡¡¡¡Ctrl+L ²Á³ý²¢ÇÒÖØдÆÁÄ»¡£
¡¡¡¡h»òÕß? ÏÔʾ°ïÖú»Ã棬¸ø³öһЩ¼ò¶ÌµÄÃüÁî×ܽá˵Ã÷¡£
¡¡¡¡k ÖÕÖ¹Ò»¸ö½ø³Ì¡£ÏµÍ³½«ÌáʾÓû§ÊäÈëÐèÒªÖÕÖ¹µÄ½ø³ÌPID£¬ÒÔ¼°ÐèÒª·¢Ë͸ø¸Ã½ø³ÌʲôÑùµÄÐźš£Ò»°ãµÄÖÕÖ¹½ø³Ì¿ÉÒÔʹÓÃ15Ðźţ»Èç¹û²»ÄÜÕý³£½áÊøÄǾÍʹÓÃÐźÅ9Ç¿ÖƽáÊø¸Ã½ø³Ì¡£Ä¬ÈÏÖµÊÇÐźÅ15¡£ÔÚ°²È«Ä£Ê½ÖдËÃüÁî±»ÆÁ±Î¡£
¡¡¡¡i ºöÂÔÏÐÖúͽ©ËÀ½ø³Ì¡£ÕâÊÇÒ»¸ö¿ª¹ØʽÃüÁî¡£
¡¡¡¡q Í˳ö³ÌÐò¡£
¡¡¡¡r ÖØа²ÅÅÒ»¸ö½ø³ÌµÄÓÅÏȼ¶±ð¡£ÏµÍ³ÌáʾÓû§ÊäÈëÐèÒª¸Ä±äµÄ½ø³ÌPIDÒÔ¼°ÐèÒªÉèÖõĽø³ÌÓÅÏȼ¶Öµ¡£ÊäÈëÒ»¸öÕýÖµ½«Ê¹ÓÅÏȼ¶½µµÍ£¬·´Ö®Ôò¿ÉÒÔʹ¸Ã½ø³ÌÓµÓиü¸ßµÄÓÅÏÈȨ¡£Ä¬ÈÏÖµÊÇ10¡£
¡¡¡¡S Çл»µ½ÀÛ¼Æģʽ¡£
¡¡¡¡s ¸Ä±äÁ½´ÎË¢ÐÂÖ®¼äµÄÑÓ³Ùʱ¼ä¡£ÏµÍ³½«ÌáʾÓû§ÊäÈëеÄʱ¼ä£¬µ¥Î»Îªs¡£Èç¹ûÓÐСÊý£¬¾Í»»Ëã³Ém s¡£ÊäÈë0ÖµÔòϵͳ½«²»¶ÏˢУ¬Ä¬ÈÏÖµÊÇ5 s¡£ÐèҪעÒâµÄÊÇÈç¹ûÉèÖÃ̫СµÄʱ¼ä£¬ºÜ¿ÉÄÜ»áÒýÆ𲻶ÏˢУ¬´Ó¶ø¸ù±¾À´²»¼°¿´ÇåÏÔʾµÄÇé¿ö£¬¶øÇÒϵͳ¸ºÔØÒ²»á´ó´óÔö¼Ó¡£
¡¡¡¡f»òÕßF ´Óµ±Ç°ÏÔʾÖÐÌí¼Ó»òÕßɾ³ýÏîÄ¿¡£
¡¡¡¡o»òÕßO ¸Ä±äÏÔʾÏîÄ¿µÄ˳Ðò¡£
¡¡¡¡l Çл»ÏÔʾƽ¾ù¸ºÔغÍÆô¶¯Ê±¼äÐÅÏ¢¡£
¡¡¡¡m Çл»ÏÔʾÄÚ´æÐÅÏ¢¡£
¡¡¡¡t Çл»ÏÔʾ½ø³ÌºÍCPU״̬ÐÅÏ¢¡£
¡¡¡¡c Çл»ÏÔʾÃüÁîÃû³ÆºÍÍêÕûÃüÁîÐС£
¡¡¡¡M ¸ù¾ÝפÁôÄÚ´æ´óС½øÐÐÅÅÐò¡£
¡¡¡¡P ¸ù¾ÝCPUʹÓðٷֱȴóС½øÐÐÅÅÐò¡£
¡¡¡¡T ¸ù¾Ýʱ¼ä/ÀÛ¼Æʱ¼ä½øÐÐÅÅÐò¡£
W ½«µ±Ç°ÉèÖÃдÈë~/.toprcÎļþÖС£ÕâÊÇдtopÅäÖÃÎļþµÄÍƼö·½·¨¡£
ÍƼöÐÅÏ¢
- 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µÈ
ÆÀÂÛ