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:f8b746d2clearcase/" target="_blank" >cc="xuewl"]
請教個問題:pi &po 的值是多少為正常?[/quote:f8b746d2cc] 很難確定,PI和PO不為零說明發生了頁面交換,只能懷疑內存不夠用,還許其他工具配合確定 |
softarts 回復于:2003-07-06 19:34:23 |
不知為什么,vmstat看到的和top看到的不一致.
最后我以top為準了 |