谢谢
westwest 回复于:2003-07-04 10:28:02 |
论坛里一大把,你先搜索先 |
默默 回复于:2003-07-04 10:50:38 |
vmstat 命令报告虚拟内存统计信息和CPU负荷:页面调度,交换,任务交换,CPU利用率。命令的语法是:
vmstat [-cisS] [d1 d2 d3 d4] [interval [count]] 当不用选项时,vmstat显示一条曲线表示自从系统启动后活动的信息。如果指定interval(时间间隔),接下来的线是重复显示最后的interval期间活动的情况,直到用户中断命令执行。当同时提供计数器时,统计信息按时间计数来显示。 如果指定了一个磁盘名(如d1,d2,等等。),这些磁盘得到优先显示。通常,系统上的前4个磁盘设备是显示的,因为只有四个设备能在一线条上显示,这个选项允许性能分析员修改缺省显示选项。(*磁盘名通常随id,sd,xd,或xy (取决于类型和I/0界面)加一个数字,如id0,sd2,xd1等等命名而定。) ,vmstat 命令显示若干字段信息: procs 报表下面三种状态的进程数: r--在运行队列中等候运行 b--被资源阻塞(I/0,页面调度,等等.) w--可运行但是被换出的 memory 报告虚拟内存和实存信息: swap--以千字节为单位的当前可用交换空间的数量 free--以千字节为单位的页自由表大小 page 报告每秒页面调度活动数量的信息: re-从自由表回收页 mf--次要的错误;地址空间或硬件地址转换错误 pi--页入的千字节数 po -页出的千字节数 fr- 释放的千字节数 de--以千字节为单位的可接受的短期内存不足数 sr--页由时钟算法扫描 disk 可以为四个磁盘报告每秒磁盘I/O的数量 faults 报告每秒系统软件中断和硬件中断的速率 in-设备中断,不包括系统时钟中断 sy-系统调用 cs-CPU任务(上下文)交换 cpu-- CPU故障时间的百分比,在多处理器系统上,这是全部处理器的平均值: us- 用户时间 sy-- 系统时间 id-- 闲置时间 vmstat命令有四个可选标志可供使用。如果机器有虚拟地址缓存-c标志就改变输出报告缓存刷新统计数据。报告包括自从系统启动后每种缓存刷新全部总量。六个缓存类型是用户,上下文,区域,段,页,部分页。 -i标志 使输出变为报告中断的数量。如果给出设备名,如d1,d2等,监控将在设备级*执行,(*注,参阅第十二章有关打开设备级监控的信息。)并报告每个给定设备的统计信息。 修改"普通"报告来显示交换而非页面调度活动的信息。这选项改变显示的两个字段:si(换入)和so(换出)替代了re和mf字段。 值得注意是,interval 和count选项对-i或-s选项是非法的。 |
默默 回复于:2003-07-04 10:51:11 |
vmstat
The first line of vmstat represents a summary of information since boot time. To obtain useful real-time statistics, run vmstat with a time step (eg vmstat 30). The vmstat output columns are as follows use the pagesize command to determine the size of the pages): · procs/r: Run queue length. · procs/b: Processes blocked while waiting for I/O. · procs/w: Idle processes which have been swapped. · memory/swap: Free, unreserved swap space (Kb). · memory/free: Free memory (Kb). (Note that this will grow until it reaches lotsfree, at which point the page scanner is started. See "Paging" for more details.) · page/re: Pages reclaimed from the free list. (If a page on the free list still contains data needed for a new request, it can be remapped.) · page/mf: Minor faults (page in memory, but not mapped). (If the page is still in memory, a minor fault remaps the page. It is comparable to the vflts value reported by sar -p.) · page/pi: Paged in from swap (Kb/s). (When a page is brought back from the swap device, the process will stop execution and wait. This may affect performance.) · page/po: Paged out to swap (Kb/s). (The page has been written and freed. This can be the result of activity by the pageout scanner, a file close, or fsflush.) · page/fr: Freed or destroyed (Kb/s). (This column reports the activity of the page scanner.) · page/de: Freed after writes (Kb/s). (These pages have been freed due to a pageout.) · page/sr: Scan rate (pages). Note that this number is not reported as a "rate," but as a total number of pages scanned. · disk/s#: Disk activity for disk # (I/O's per second). · faults/in: Interrupts (per second). · faults/sy: System calls (per second). · faults/cs: Context switches (per second). · cpu/us: User CPU time (%). · cpu/sy: Kernel CPU time (%). · cpu/id: Idle + I/O wait CPU time (%). vmstat -i reports on hardware interrupts. vmstat -s provides a summary of memory statistics, including statistics related to the DNLC, inode and rnode caches. vmstat -S reports on swap-related statistics such as: · si: Swapped in (Kb/s). · so: Swap outs (Kb/s). (Note that the man page for vmstat -s incorrectly describes the swap queue length. In Solaris 2, the swap queue length is the number of idle swapped-out processes. (In SunOS 4, this referred to the number of active swapped-out processes.) Solaris 8 vmstat under Solaris 8 will report different statistics than would be expected under an earlier version of Solaris due to a different paging algorithm: · Page Reclaim rate higher. · Higher reported Free Memory: A large component of the filesystem cache is reported as free memory. · Low Scan Rates: Scan rates will be near zero unless there is a systemwide shortage of available memory. vmstat -p reports paging activity details for applications (executables), data (anonymous) and filesystem activity. |
xuewl 回复于:2003-07-04 14:38:11 |
[quote:b408dea09f="默默"]vmstat
The first line of vmstat represents a summary of information since boot time. To obtain useful real-time statistics, run vmstat with a time step (eg vmstat 30). The vmstat output columns are..........[/quote:b408dea09f] 请教个问题:pi &po 的值是多少为正常? |
phoenixli 回复于:2003-07-06 15:09:46 |
默默超级厉害~~ |
race 回复于:2003-07-06 15:26:21 |
[quote:f8b746d2cc="xuewl"]
请教个问题:pi &po 的值是多少为正常?[/quote:f8b746d2cc] 很难确定,PI和PO不为零说明发生了页面交换,只能怀疑内存不够用,还许其他工具配合确定 |
softarts 回复于:2003-07-06 19:34:23 |
不知为什么,vmstat看到的和top看到的不一致.
最后我以top为准了 |
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/