vmstat

 vmstat工具概述



Procs
    r: The number of processes waiting for run time.
    b: The number of processes in uninterruptible sleep.

Memory
    swpd: the amount of virtual memory used.
    free: the amount of idle memory.
    buff: the amount of memory used as buffers.
    cache: the amount of memory used as cache.
    inact: the amount of inactive memory. (-a option)
    active: the amount of active memory. (-a option)

Swap
    si: Amount of memory swapped in from disk (/s).
    so: Amount of memory swapped to disk (/s).

IO
    bi: Blocks received from a block device (blocks/s).
    bo: Blocks sent to a block device (blocks/s).

System
    in: The number of interrupts per second, including the clock.
    cs: The number of context switches per second.

CPU
    These are percentages of total CPU time.
    us: Time spent running non-kernel code. (user time, including nice time)
    sy: Time spent running kernel code. (system time)
    id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
    wa: Time spent waiting for IO. Prior to Linux 2.5.41, shown as zero.
     
	5.1.2 在vmstat中得到什么?
		r(运行队列)
		pi(页导入)
		us()
		sy()
		id()
		wa()
	5.1.3 识别cpu瓶颈
		1. 显示IBM AIX和HP/ux的cpu数量:lsdev -C|grep Process | wc -l
		2. 显示solaris的cpu数量:psrinfo -v |grep "Status of processor" |wc -l
		3. 显示linux的cpu数量:cat /proc/cpuinfo|grep processor | wc -l
		在b列中出现非0表示cpu瓶颈;
		解决方案:
		1. 给服务器增加更多的cpu
		2. 通过讲大规模的批处理任务安排在不繁忙的时期执行,来均衡系统任务
		3. 调整已有任务的分派优先级
	5.1.4 使用vmstat识别频繁使用的cpu		
		us+sy接近100,只能表示cpu正在满负荷运行,唯一能够指出cpu瓶颈的度量是运行队列r值超过了服务器上的cpu数量
	5.1.5 识别ram内存瓶颈
	  1. 显示DEC-UNIX上的ram大小:uerf -r 300 | grep -i mem
	  2. 显示hp/ux上的ram大小:dmesg
	  3. 显示aix上的ram大小:lsdev -C|grep mem  , lsattr - E1 mem0
	  4. 显示solaris的ram大小: prtconf |grep -i mem
	  5. 显示linux的ram大小:  free
	  6. 使用top工具查看ram,如下有807012k
	  		top - 01:14:47 up 2 days, 13:03,  4 users,  load average: 0.12, 0.07, 0.04
				Tasks: 104 total,   1 running, 103 sleeping,   0 stopped,   0 zombie
				Cpu(s):  1.8% us,  5.4% sy,  0.1% ni, 92.1% id,  0.7% wa,  0.1% hi,  0.0% si
				Mem:    807012k total,   787844k used,    19168k free,    16296k buffers
				Swap:   524280k total,    23448k used,   500832k free,   594024k cached
		7. 使用glance看内存
		8. ram内存和交换内存
			解决页导入问题的方案:
				1>更小的sga   2>更多ram内存  3>减少ram需求
		9. 在aix中检测潜在的i/o瓶颈
				通过vmstat的wa来看
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值