成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

Unixvmstat命令-創(chuàng)新互聯(lián)

Virtual Memory Statistics ( vmstat ) 是報告關(guān)于進程,虛擬內(nèi)存,磁盤,CPU活動的一個統(tǒng)計報告。

成都網(wǎng)站建設(shè)、做網(wǎng)站服務(wù)團隊是一支充滿著熱情的團隊,執(zhí)著、敏銳、追求更好,是創(chuàng)新互聯(lián)的標準與要求,同時竭誠為客戶提供服務(wù)是我們的理念。成都創(chuàng)新互聯(lián)公司把每個網(wǎng)站當做一個產(chǎn)品來開發(fā),精雕細琢,追求一名工匠心中的細致,我們更用心!

在一個多CPU系統(tǒng)中,vmstat統(tǒng)計所有個數(shù)的CPU的平均輸出。為每個進程進行統(tǒng)計。沒有參數(shù)時,vmstat顯示每一行是自從系統(tǒng)啟動以后的虛擬內(nèi)存的活動情況。

vmstat 的語法我們可以通過linux的man 命令來查看。

將man 的結(jié)果導(dǎo)入到指定的文本

# man vmstat|col -b > /u01/tianlesoftware.txt

查看vmstat 用法

# man vmstat

VMSTAT(8)  Linux Administrator’s Manual   VMSTAT(8)

NAME

vmstat - Report virtual memory statistics

SYNOPSIS

vmstat [-a] [-n] [delay [ count]]

vmstat [-f] [-s] [-m]

vmstat [-S unit]

vmstat [-d]

vmstat [-p disk partition]

vmstat [-V]

DESCRIPTION

vmstat  reports information about processes, memory, paging, block IO,traps, and cpu activity.The first report produced gives averages since the last reboot. Additional  reports give information on a sampling period of length delay.The process and memory reports are instantaneous in either case.

Options

The -a  switch displays active/inactive memory, given a  2.5.41  kernelor better.

The  -f  switch displays the number of forks since boot. This includes the fork, vfork, and clone system calls,  and  is equivalent  to the total  number  of tasks created. Each process is represented by one or more tasks, depending on thread usage.This display does not  repeat.

The -m displays slabinfo.

The  -n switch causes the header to be displayed only once rather than periodically.

The -s switch displays a table of various event counters  and  memory statistics. This display does not repeat.Delay  is the delay between updates in seconds. If no delay is specified, only one report is printed with the average values since boot.count is the number of updates. If no count is specified and delay is defined, count defaults to infinity.

The -d reports disk statistics (2.5.70 or above required)

The -p followed by some partition name for detailed statistics (2.5.70 or above required)

The -S followed by k or K or m or M  switches  outputs  between 1000,1024, 1000000, or 1048576 bytes

The -V switch results in displaying version information.

FIELD DESCRIPTION FOR VM MODE

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.

FIELD DESCRIPTION FOR DISK MODE

Reads

total: Total reads completed successfully

merged: grouped reads (resulting in one I/O)

sectors: Sectors read successfully

ms: milliseconds spent reading

Writes

total: Total writes completed successfully

merged: grouped writes (resulting in one I/O)

sectors: Sectors written successfully

ms: milliseconds spent writing

IO

cur: I/O in progress

s: seconds spent for I/O

FIELD DESCRIPTION FOR DISK PARTITION MODE

reads: Total number of reads issued to this partition

read sectors: Total read sectors for partition

writes : Total number of writes issued to this partition

requested writes: Total number of write requests made for partition

FIELD DESCRIPTION FOR SLAB MODE

cache: Cache name

num: Number of currently active objects

total: Total number of available objects

size: Size of each object

pages: Number of pages with at least one active object

totpages: Total number of allocated pages

pslab: Number of pages per slab

NOTES

vmstat does not require special permissions.

These reports are intended to help identify system bottlenecks. Linux vmstat does not count itself as a running process.All linux blocks are currently 1024  bytes.  Old  kernels  may  report blocks as 512 bytes, 2048 bytes, or 4096 bytes.Since  procps 3.1.9, vmstat lets you choose units (k, K, m, M) default is K (1024 bytes) in the default mode vmstat uses slabinfo 1.1 FIXME

FILES

/proc/meminfo

/proc/stat

/proc/*/stat

SEE ALSO

iostat(1), sar(1), mpstat(1), ps(1), top(1), free(1)

BUGS

Does not tabulate the block io per device or count the number of  system calls.

AUTHORS

Written by Henry Ware <al172@yfn.ysu.edu>.

Fabian Frédérick <ffrederick@users.sourceforge.net> (diskstat, slab, partitions…)

Throatwobbler Ginkgo Labs 27 July 1994   VMSTAT(8)

示例:

# vmstat 2 10

procs -----------memory----------------------  -----swap---  -----io----  ---system--- ----cpu------

r  b   swpd  free  buff  cache   si  so   bi   bo  in   cs  us sy id wa

1  1   208  28960  38128 268204   0   0  278   40 1050  370  5 46 44  5

1  0   208  28896  38128 268204   0   0  128   0 1054  310  4 38 58  1

2  0   208  28896  38136 268196   0   0  257   55 1056  301  4 39 52  5

2  0   208  24896  38136 268196   0   0  257   1 1042  593  6 87  7  0

0  0   208  28672  38136 268196   0   0  257   25 1052  372  4 46 45  5

0  0   208  28824  38140 268192   0   0  129  111 1052  316  3 32 64  1

1  0   208  28768  38148 268184   0   0  257  109 1050  286  9 70 21  1

1  0   208  28512  38148 268184   0   0  257   1 1046  327  6 48 43  2

0  0   208  28832  38148 268184   0   0  257   1 1047  313  5 42 52  1

0  0   208  28832  38152 268180   0   0  257  109 1050  308  4 33 59  5

每2秒顯示一次,共顯示10次。

在Unix(Solaris)平臺下:

-bash-3.00$ vmstat 2 10

kthr    memory       page       disk      faults    cpu

r b w  swap  free  re  mf pi po fr de sr s0 s1 -- --  in  sy  cs us sy id

0 0 0 5016344 4200040 126 512 35 0 0 0  0  0  1  0  0  731 1416  723  3  0 97

0 0 0 2065576 2375112 14 54 0  0  0  0  0  0  0  0  0  870  625  950  3  0 96

0 0 0 2065512 2375048 11 50 0  0  0  0  0  0  0  0  0  951  529 1066  3  0 97

0 0 0 2065512 2375048 11 53 0  0  0  0  0  0  0  0  0  852  548  934  3  0 97

0 0 0 2065512 2375048 4 40  0  0  0  0  0  0  0  0  0  836  483  907  3  0 97

0 0 0 2065512 2375048 14 46 0  0  0  0  0  0  0  0  0  873  632  958  3  0 97

0 0 0 2065512 2375048 0  0  0  0  0  0  0  0  0  0  0  812  417  863  3  0 97

0 0 0 2065512 2375048 4 40  0  0  0  0  0  0  0  0  0  810  481  874  3  0 97

0 0 0 2065384 2374920 0  0  0  0  0  0  0  0  1  0  0  801  406  862  3  0 96

0 0 0 2065384 2374920 14 46 0  0  0  0  0  0  0  0  0  817  545  898  3  0 97

一些標準說明:

CPU:

1) 如果(process r)是連續(xù)的大于在系統(tǒng)中的CPU的個數(shù)表示系統(tǒng)現(xiàn)在運行比較慢,有多數(shù)的進程等待CPU.

2) 如果r的輸出數(shù)大于系統(tǒng)中可用CPU個數(shù)的4倍的話,則系統(tǒng)面臨著CPU短缺的問題,或者是CPU的速率過低,系統(tǒng)中有多數(shù)的進程在等待CPU,造成系統(tǒng)中進程運行過慢。

3) 如果空閑時間(cpu id)持續(xù)為0并且系統(tǒng)時間(cpu sy)是用戶時間的兩倍(cpu us) 系統(tǒng)則面臨著CPU資源的短缺。

簡單的說就是:

r 和 b 不高于5,如果r 經(jīng)常大于4,且id 經(jīng)常少于40,則表示CPU 負荷很重。

us+sy 不超過80%,如果大于80,進程就會在運行隊列中花費等待時間,響應(yīng)時間和吞吐量就會下降。

wa 不超過25, 如果說wa >40表明磁盤io沒有也許存在不合理的平衡,或者對磁盤操作比較頻繁

一般情況下,導(dǎo)致CPU資源不足都是應(yīng)用程序的問題。比如一些SQL語句不合理等等都會造成這樣的現(xiàn)象。

內(nèi)存:

si和so基本為零。 其中si表示當前每秒交換回內(nèi)存(Swap in)的總量,單位為kbytes;so表示當前每秒交換出內(nèi)存(Swap out)的總量,單位為kbytes。如果si,so 長期不等于0,表示系統(tǒng)使用swap 頻繁,即內(nèi)存不足。

一般情況下,如果內(nèi)存的占用率比較高,但是,CPU的占用很低的時候,可以考慮是有很多的應(yīng)用程序占用了內(nèi)存沒有釋放。

要注意的是,Linux 內(nèi)存在使用后不會釋放,所以一般會看到內(nèi)存使用率很高,要判斷l(xiāng)inux 內(nèi)存是否正常,需要通過對swap 交換區(qū)的交換頻率來看。

oracle視頻教程請關(guān)注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

當前標題:Unixvmstat命令-創(chuàng)新互聯(lián)
鏈接地址:http://jinyejixie.com/article10/djcigo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動態(tài)網(wǎng)站、靜態(tài)網(wǎng)站、商城網(wǎng)站、網(wǎng)站營銷網(wǎng)站策劃、品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)