黄色片网站免费观看-黄色片网站观看-黄色片网站大全-黄色片视频网-色偷偷网址-色偷偷网站

mpstat

顯示各個(gè)可用CPU的狀態(tài)

補(bǔ)充說(shuō)明

mpstat命令 指令主要用于多CPU環(huán)境下,它顯示各個(gè)可用CPU的狀態(tài)系你想。這些信息存放在/proc/stat文件中。在多CPUs系統(tǒng)里,其不但能查看所有CPU的平均狀況信息,而且能夠查看特定CPU的信息。

語(yǔ)法

mpstat(選項(xiàng))(參數(shù))

選項(xiàng)

-P:指定CPU編號(hào)。

參數(shù)

實(shí)例

當(dāng)mpstat不帶參數(shù)時(shí),輸出為從系統(tǒng)啟動(dòng)以來(lái)的平均值。

mpstat
Linux 2.6.9-5.31AXsmp (builder.redflag-linux.com) 12/16/2005
09:38:46 AM CPU %user %nice %system %iowait %irq %soft %idle intr/s
09:38:48 AM all 23.28 0.00 1.75     0.50 0.00 0.00 74.47 1018.59

每2秒產(chǎn)生了2個(gè)處理器的統(tǒng)計(jì)數(shù)據(jù)報(bào)告:

下面的命令可以每2秒產(chǎn)生了2個(gè)處理器的統(tǒng)計(jì)數(shù)據(jù)報(bào)告,一共產(chǎn)生三個(gè)interval 的信息,然后再給出這三個(gè)interval的平均信息。默認(rèn)時(shí),輸出是按照CPU 號(hào)排序。第一個(gè)行給出了從系統(tǒng)引導(dǎo)以來(lái)的所有活躍數(shù)據(jù)。接下來(lái)每行對(duì)應(yīng)一個(gè)處理器的活躍狀態(tài)。。

mpstat -P ALL 2 3
Linux 2.6.18-164.el5 (server.sys.com)    01/04/2010
09:34:20 PM CPU   %user   %nice    %sys %iowait    %irq   %soft %steal   %idle    intr/s
09:34:22 PM all    0.00    0.00    0.00    0.00    0.00    0.00    0.00 100.00   1001.49
09:34:22 PM    0    0.00    0.00    0.50    0.00    0.00    0.00    0.00   99.50   1001.00
09:34:22 PM    1    0.00    0.00    0.00    0.00    0.00    0.00    0.00 100.00      0.00

比較帶參數(shù)和不帶參數(shù)的mpstat的結(jié)果:

在后臺(tái)開(kāi)一個(gè)2G的文件

cat 1.img &

然后在另一個(gè)終端運(yùn)行mpstat命令

mpstat
Linux 2.6.18-164.el5 (server.sys.com)    01/04/2010
10:17:31 PM CPU   %user   %nice    %sys %iowait    %irq   %soft %steal   %idle    intr/s
10:17:31 PM all    0.07    0.02    0.25    0.21    0.01    0.04    0.00   99.40   1004.57
mpstat
Linux 2.6.18-164.el5 (server.sys.com)    01/04/2010
10:17:35 PM CPU   %user   %nice    %sys %iowait    %irq   %soft %steal   %idle    intr/s
10:17:35 PM all    0.07    0.02    0.25    0.21    0.01    0.04    0.00   99.39   1004.73
mpstat 3 10
Linux 2.6.18-164.el5 (server.sys.com)    01/04/2010
10:17:55 PM CPU   %user   %nice    %sys %iowait    %irq   %soft %steal   %idle    intr/s
10:17:58 PM all   13.12    0.00   20.93    0.00    1.83    9.80    0.00   54.32   2488.08
10:18:01 PM all   10.82    0.00   19.30    0.83    1.83    9.32    0.00   57.90   2449.83
10:18:04 PM all   10.95    0.00   20.40    0.17    1.99    8.62    0.00   57.88   2384.05
10:18:07 PM all   10.47    0.00   18.11    0.00    1.50    8.47    0.00   61.46   2416.00
10:18:10 PM all   11.81    0.00   22.63    0.00    1.83   11.98    0.00   51.75   2210.60
10:18:13 PM all    6.31    0.00   10.80    0.00    1.00    5.32    0.00   76.58   1795.33
10:18:19 PM all    1.75    0.00    3.16    0.75    0.25    1.25    0.00   92.85   1245.18
10:18:22 PM all   11.94    0.00   19.07    0.00    1.99    8.29    0.00   58.71   2630.46
10:18:25 PM all   11.65    0.00   19.30    0.50    2.00    9.15    0.00   57.40   2673.91
10:18:28 PM all   11.44    0.00   21.06    0.33    1.99   10.61    0.00   54.56   2369.87
Average:     all    9.27    0.00   16.18    0.30    1.50    7.64    0.00   65.11   2173.54

上兩表顯示出當(dāng)要正確反映系統(tǒng)的情況,需要正確使用命令的參數(shù)。vmstat 和iostat 也需要注意這一問(wèn)題。