linuxÔõôÉó²éÏß³ÌÊý
linux Éó²éÏß³ÌÊýµÄÒªÁ죺Éó²éÌض¨Àú³ÌÏß³ÌÊý£ºps -elf | grep pid£ºÏÔʾÀú³Ì pid µÄÏß³ÌÊýtop -h -p pid£º½»»¥Ê½ÏÔʾÀú³Ì pid µÄÏß³ÌÊýÉó²éϵͳËùÓÐÏß³ÌÊý£ºgrep ^threads /proc/stat£º¼ìË÷ϵͳËùÓÐÏß³ÌÊýcat /proc/cpuinfo | grep “processor” | wc -l£º¼ÆÊý´¦ÀíÆ÷ÊýÄ¿£¬Ã¿¸ö´¦ÀíÆ÷ͨ³£ÓÐÒ»¸öÏß³ÌʹÓõÚÈý·½¹¤¾ß£ºhtop£º½»»¥Ê½ÏÔʾϵͳËùÓÐÀú³ÌºÍÏß³ÌÐÅÏ¢£¬°üÀ¨Ïß³ÌÊýatop£ºÏµÍ³ÐÔÄܼà¿Ø¹¤¾ß£¬ÏÔʾϵͳËù
Linux ÖÐÉó²éÏß³ÌÊýµÄÒªÁì
1. Éó²éÌض¨Àú³ÌµÄÏß³ÌÊý
ps -eLf | grep PID
´ËÏÂÁÏÔʾÀú³Ì PID µÄÏß³ÌÊý£¬ÆäÖУº
-e£ºÏÔʾËùÓÐÀú³Ì
-Lf£ºÏÔʾÏêϸÐÅÏ¢£¬°üÀ¨Ïß³ÌÐÅÏ¢
PID£ºÒª¼ì²éµÄÀú³Ì ID
top -H -p PID
´ËÏÂÁîÆô¶¯½»»¥Ê½ top ÊÊÓóÌÐò£¬²¢ÏÔʾָ¶¨Àú³Ì PID µÄÏß³ÌÊý¡£
2. Éó²éϵͳÖеÄËùÓÐÏß³ÌÊý
grep ^Threads /proc/stat
´ËÏÂÁî´Ó /proc/stat ÎļþÖмìË÷ϵͳÖÐËùÓÐÏß³ÌÊýµÄÐÅÏ¢¡£
cat /proc/cpuinfo | grep “processor” | wc -l
´ËÏÂÁî¼ÆÊý /proc/cpuinfo ÎļþÖд¦ÀíÆ÷µÄÊýÄ¿£¬ÓÉÓÚÿ¸ö´¦ÀíÆ÷ͨ³£ÓÐÒ»¸öÏ̡߳£
3. ʹÓõÚÈý·½¹¤¾ß
htop
htop ÊÇÒ»¸ö½»»¥Ê½Àú³ÌÉó²éÆ÷£¬¿ÉÏÔʾϵͳÖÐËùÓÐÀú³ÌºÍÏ̵߳ÄÐÅÏ¢£¬°üÀ¨Ïß³ÌÊý¡£
atop
atop ÊÇÒ»¸öϵͳÐÔÄܼà¿Ø¹¤¾ß£¬¿ÉÏÔʾϵͳÖÐËùÓÐÀú³ÌºÍÏ̵߳ÄÏêϸÐÅÏ¢£¬°üÀ¨Ïß³ÌÊý¡£
ÒÔÉϾÍÊÇlinuxÔõôÉó²éÏß³ÌÊýµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡