设为首页 加入收藏

TOP

浅析vmstat命令(一)
2014-11-24 07:55:18 来源: 作者: 【 】 浏览:14
Tags:浅析 vmstat 命令

vmstat命令从名称可以看出是关于虚拟内存统计信息的,本文针对aix环境下的vmstat命令进行简单语法说明。

命令格式:

usage: vmstat [ -fsviItlw ] [ [ -p | -P ]  pagesize | ALL ] [Drives] [ Interval [Count] ]

命令用途:

The vmstat command reports statistics about kernel threads, virtual memory, disks, traps and pocessor activity. Reports generated by the vmstat command can be used to balance system load activity. These system-wide statistics (among all processors) are calculated as averages for values expressed as percentages, and as sums otherwise. Thevmstat command might return inconsistent statistics because the statistics are not read atomically.

vmstat命令用来报告与内核线程,虚拟内存,磁盘,陷阱和处理器活动有关的统计信息。根据该命令生成的报告我们可以平衡系统的活动负载。这些系统范围的统计信息按照其平均值的百分比形式或者累积总值的形式展现出来。由于该命令在统计信息的收集时并不是原子性的,因此统计信息可能会存在不一致性。

If the vmstat command is invoked without flags, the report contains a summary of the virtual memory activity since system startup.

The Interval parameter specifies the amount of time in seconds between each report. If the Interval parameter is not specified, the vmstat command generates a single report that contains statistics for the time since system startup and then exits. The Count parameter can only be specified with the Interval parameter. If the Count parameter is specified, its value determines the number of reports generated and the number of seconds apart. If the Interval parameter is specified without the Count parameter, reports are continuously generated. A Count parameter of 0 is not allowed.

如果没有指定任何选项,则vmstat命令返回自系统启动以来虚拟内存活动的总统计信息。

Interval参数指定了每次报告之间的时间间隔,如果没有指定interval参数,vmstat命令生成自系统启动以来所有统计信息的单一报告。count参数需要与interval参数配合使用,如果指定了count参数,该参数决定了报告的生成数量,如果指定了interval但是没有指定count,报告会一直生成下去。count的取值不可以为0.

AIX 4.3.3 and later contain enhancements to the method used to compute the percentage of processor time spent waiting on disk I/O (wio time). The method used in AIX 4.3.2 and earlier versions of the operating system can, under certain circumstances, give an inflated view of wio time on SMPs.

The method used in AIX 4.3.2 and earlier versions is as follows: At each clock interrupt on each processor (100 times a second per processor), a determination is made as to which of the four categories (usr/sys/wio/idle) to place the last 10 ms of time. If the processor was busy in usr mode at the time of the clock interrupt, then usr gets the clock tick added into its category. If the processor was busy in kernel mode at the time of the clock interrupt, then the sys category gets the tick. If the processor was not busy, a check is made to see if any I/O to disk is in progress. If any disk I/O is in progress, the wio category is incremented. If no disk I/O is in progress and the processor is not busy, the idle category gets the tick. The inflated view of wio time results from all idle processors being categorized as wio regardless of the number of threads waiting on I/O. For example, systems with just one thread doing I/O could report over 90 percent wio time regardless of the number of processors it has. The wio time is reported by the commands sar(%wio), vmstat (wa) and iostat (% iowait).

AIX 4.3.3及其后续版本对cpu花费在DISK I/O(wio)上的时间计算方法进行了增强,在以前的版本中,在特定的情况下,会过高估计SMPs环境下wio的数值。

在AIX 4.3.2和之前的版本中,计算方法如下:在每个处理器的时钟中断时(每个处理器没秒钟发生100次),会判定最后的10ms时间属于usr/sys/wio/idle四分类中的哪个分类,如果在时钟中断时,处理器处于usrmode,那么其从属与usr分类。如果处理器处于kernel mode,那么从属于sys分类。如果处理器是空闲的,会坚持时钟存在磁盘输入输出操作,如果存在磁盘输入输出操作,那么从属于wio分类,否则从属于idle分类。之所以会过高估计wio的值,是因为当多个处理器空闲时,不管存在多少等待输入输出的线程,这些处理器都会被判定为wio。例如在仅仅具有单一

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 1/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Mysql有无groupby对max函数查询结.. 下一篇hbase:应用开发,hbase表操作及..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C语言中,“指针”用 (2025-12-26 15:20:18)
·在c语言的指针运算中 (2025-12-26 15:20:15)
·C语言-函数指针与函 (2025-12-26 15:20:12)
·求navicat for mysql (2025-12-26 13:21:33)
·有哪位大哥推荐一下m (2025-12-26 13:21:30)