Sorry, terminal is not big enough的解决方法

用top命令,按数字1键,可以查看CPU各个核心使用情况,不过在CPU个数比较多时可能提示:Sorry, terminal is not big enough。如下图:

terminal-big-enough

解决方法有三种:

1、当CPU数超出终端大小不多时,可以通过ALT + Enter 最大化当前窗口(SecureCRT客户端时);

2、mpstat -P ALL

3、sar -P ALL

方法1一般不会有效果。这里主要说要方法2和方法3。

后两者都是sysstat工具包里的工具,可以详细查看IO、CPU、MEM等信息。详细可以查看sysstat工具的用法

mpstat指令

mpstat -P ALL默认是查看当前各CPU的使用情况,由于此处该主机上两个CPU核心,所以就显示两个CPU,0代表cpu0,1代表cpu1 。

[root@361way ~]# mpstat -P ALL
Linux 2.6.32-504.el6.x86_64 (361way.com)        01/29/2012      _x86_64_        (2 CPU)
01:57:28 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
01:57:28 PM  all    0.28    0.00    0.12    0.01    0.00    0.00    0.00    0.00   99.59
01:57:28 PM    0    0.29    0.00    0.12    0.01    0.00    0.00    0.00    0.00   99.59
01:57:28 PM    1    0.28    0.00    0.13    0.01    0.00    0.00    0.00    0.00   99.58
<br />

想要实时查看,可以后需增加间隔参数,如每隔2秒输出一次,共输出100次,可以使用下面的命令:

# mpstat -P ALL 2 100
<br />

sar指令

通过sar -P ALL 默认查看的是所有历史的CPU 信息。数据结果默认是每隔10分钟输出一次:

[root@361way ~]# sar -P ALL
Linux 2.6.32-504.el6.x86_64 (361way.com)        01/29/2012      _x86_64_        (2 CPU)
12:00:01 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
12:10:01 AM     all      0.32      0.00      0.14      0.00      0.00     99.54
12:10:01 AM       0      0.33      0.00      0.14      0.00      0.00     99.53
12:10:01 AM       1      0.31      0.00      0.13      0.01      0.00     99.55
12:10:01 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
12:20:01 AM     all      0.42      0.00      0.16      0.00      0.00     99.42
12:20:01 AM       0      0.42      0.00      0.15      0.00      0.00     99.43
12:20:01 AM       1      0.43      0.00      0.17      0.01      0.00     99.40
12:20:01 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
12:30:01 AM     all      0.34      0.00      0.14      0.00      0.00     99.51
12:30:01 AM       0      0.37      0.00      0.15      0.00      0.00     99.48
12:30:01 AM       1      0.32      0.00      0.13      0.00      0.00     99.55
…………………………………………略

想要查看实时数据,也需要增加interval 参数,类似如下:

[root@361way ~]# sar -P ALL 1
Linux 2.6.32-504.el6.x86_64 (361way.com)        01/29/2012      _x86_64_        (2 CPU)
01:54:04 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
01:54:05 PM     all      4.02      0.00      1.51      0.00      0.00     94.47
01:54:05 PM       0      4.00      0.00      2.00      0.00      0.00     94.00
01:54:05 PM       1      4.00      0.00      2.00      0.00      0.00     94.00
01:54:05 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
01:54:06 PM     all      0.00      0.00      0.50      0.00      0.00     99.50
01:54:06 PM       0      0.00      0.00      0.00      0.00      0.00    100.00
01:54:06 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
01:54:06 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
01:54:07 PM     all      0.00      0.00      0.00      0.00      0.00    100.00
01:54:07 PM       0      0.00      0.00      1.00      0.00      0.00     99.00
01:54:07 PM       1      0.00      0.00      0.00      0.00      0.00    100.00
………………………………略
<br />

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注