linux SMP機器下查看每個CPU的利用率

來源:互聯網
上載者:User

硬體:8個CPU,X86_64

系統:linux debian 2.6.26 SMP

(1)用top命令查看CPU使用方式,然後按"1"可以查看到每個CPU的使用率

 

top - 13:45:55 up 4 days,  4:34,  8 users,  load average: 0.00, 0.00, 0.00
Tasks: 102 total,   1 running, 101 sleeping,   0 stopped,   0 zombie
Cpu0  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  :  0.0%us,  0.3%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu4  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu5  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu6  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu7  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   4058012k total,  3293784k used,   764228k free,   100692k buffers
Swap:   979924k total,        0k used,   979924k free,  3004012k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
   30 root      15  -5     0    0    0 S    0  0.0   4:37.52 events/3          
    1 root      20   0 12480  852  700 S    0  0.0   0:01.78 init              
    2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd   

 

(2)用top查看每個進程最近所在的cpu

按"f"給top輸出增加一欄,j--latest CPU(SMP)

  PID USER      PR  NI  VIRT  RES  SHR S %CPU P %MEM    TIME+  COMMAND                                    
    1 root      20   0 12480  852  700 S    0 6  0.0   0:01.78 init                                       
    2 root      15  -5     0    0    0 S    0 6  0.0   0:00.00 kthreadd                                   
    3 root      RT  -5     0    0    0 S    0 0  0.0   0:00.00 migration/0                                
    4 root      15  -5     0    0    0 S    0 0  0.0   0:00.00 ksoftirqd/0                                
    5 root      RT  -5     0    0    0 S    0 0  0.0   0:00.00 watchdog/0                                 
    6 root      RT  -5     0    0    0 S    0 1  0.0   0:00.00 migration/1                                
    7 root      15  -5     0    0    0 S    0 1  0.0   0:00.00 ksoftirqd/1                                
    8 root      RT  -5     0    0    0 S    0 1  0.0   0:00.00 watchdog/1                                 
    9 root      RT  -5     0    0    0 S    0 2  0.0   0:00.00 migration/2                                
   10 root      15  -5     0    0    0 S    0 2  0.0   0:00.00 ksoftirqd/2                                
   11 root      RT  -5     0    0    0 S    0 2  0.0   0:00.00 watchdog/2         

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.