/proc/stat 各個(gè)值含義CPU利用率,IOwait值
<pre>
root@test:~$ cat /proc/stat
cpu 1941775 772372 391395263 15741 122 63804 739661 0 0
cpu0 952425 334354 195819718 6674 105 58652 472818 0 0
cpu1 989349 438018 195575544 9066 16 5152 266843 0 0
intr 338195896 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 78523951 24024156 0 0 39595 0 118988669 23525422 0 0 40046 1 578 240 93577 5246701 28389836 5199780 6480912 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 488270447
btime 1495852577
processes 252979
procs_running 1
procs_blocked 0
softirq 283649281 0 78075346 10329342 46116949 0 0 1276 69418616 79806 79627946
輸出解釋
CPU 以及CPU0、CPU1每行的每個(gè)參數(shù)意思(以第一行為例)為:
user (1941775 ) 從系統(tǒng)啟動(dòng)開始累計(jì)到當(dāng)前時(shí)刻,用戶態(tài)的CPU時(shí)間(單位:jiffies) ,不包含 nice值為負(fù)進(jìn)程。1jiffies=0.01秒
nice (772372 ) 從系統(tǒng)啟動(dòng)開始累計(jì)到當(dāng)前時(shí)刻,nice值為負(fù)的進(jìn)程所占用的CPU時(shí)間(單位:jiffies)
system (391395263 ) 從系統(tǒng)啟動(dòng)開始累計(jì)到當(dāng)前時(shí)刻,核心時(shí)間(單位:jiffies)
idle (15741 ) 從系統(tǒng)啟動(dòng)開始累計(jì)到當(dāng)前時(shí)刻,除硬盤IO等待時(shí)間以外其它等待時(shí)間(單位:jiffies)
iowait (122 ) 從系統(tǒng)啟動(dòng)開始累計(jì)到當(dāng)前時(shí)刻,硬盤IO等待時(shí)間(單位:jiffies) ,
irq (63804 ) 從系統(tǒng)啟動(dòng)開始累計(jì)到當(dāng)前時(shí)刻,硬中斷時(shí)間(單位:jiffies)
softirq (739661 ) 從系統(tǒng)啟動(dòng)開始累計(jì)到當(dāng)前時(shí)刻,軟中斷時(shí)間(單位:jiffies)
CPU時(shí)間=user+system+nice+idle+iowait+irq+softirq
CPU在t1到t2時(shí)間段總的使用時(shí)間 = ( user2+ nice2+ system2+ idle2+ iowait2+ irq2+ softirq2) - ( user1+ nice1+ system1+ idle1+ iowait1+ irq1+ softirq1)
CPU在t1到t2時(shí)間段空閑使用時(shí)間 = (idle2 - idle1)
CPU在t1到t2時(shí)間段即時(shí)利用率 = 1 - CPU空閑使用時(shí)間 / CPU總的使用時(shí)間
IOWait在t1到t2時(shí)間段=(iowait 2-iowait1) / CPU總的使用時(shí)間
</pre>