In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Virtual Memory Statistics (vmstat) is a statistical report on process, virtual memory, disk, and CPU activity.
In a multi-CPU system, vmstat counts the average output of all the CPU. Do statistics for each process. When there are no parameters, vmstat shows each line the activity of virtual memory since the system was started.
The syntax of vmstat can be viewed through the linux man command.
Imports the results of man into the specified text
# man vmstat | col-b > / u01/tianlesoftware.txt
View vmstat usage
# 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 ona 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. (- an option)
Active: the amount of active memory. (- an 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 iUnip O)
Sectors: Sectors read successfully
Ms: milliseconds spent reading
Writes
Total: Total writes completed successfully
Merged: grouped writes (resulting in one iUnip 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.
Fabian Fr é d é rick (diskstat, slab, partitions... )
Throatwobbler Ginkgo Labs 27 July 1994 VMSTAT (8)
Example:
# 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
10 208 28896 38128 268204 0 0 128 0 1054 310 4 38 58 1
20 208 28896 38136 268196 0 0 257 55 1056 301 4 39 52 5
20 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
10 208 28768 38148 268184 0 0 257 109 1050 286 9 70 21 1
10 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
It is displayed every 2 seconds for a total of 10 times.
Under the Unix (Solaris) platform:
-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
000 5016344 4200040 126 512 35 000 00 1 00 731 1416 723 3 0 97
0 0 0 2065576 2375112 14 54 0 0 0 870 625 950 3 0 96
0 0 0 2065512 2375048 11 50 0 0 0 951 529 1066 3 0 97
0 0 0 2065512 2375048 11 53 0 0 0 852 548 934 3 0 97
0 0 0 2065512 2375048 4 40 0 0 0 836 483 907 3 0 97
0 0 0 2065512 2375048 14 46 0 0 0 873 632 958 3 0 97
0 0 0 2065512 2375048 0 0 0 812 417 863 3 0 97
0 0 0 2065512 2375048 4 40 0 0 0 810 481 874 3 0 97
0 0 0 2065384 2374920 0 0 0 01 0 0 801 406 862 3 0 96
0 0 0 2065384 2374920 14 46 0 0 0 817 545 898 3 0 97
Some standards state:
CPU:
1) if (process r) is continuously greater than the number of CPU in the system, it means that the system is running slowly now, and most processes are waiting for CPU.
2) if the output of r is more than 4 times the number of CPU available in the system, the system is faced with the problem of shortage of CPU, or the rate of CPU is too low, and most of the processes in the system are waiting for CPU, resulting in the slow running of the process in the system.
3) if the idle time (cpu id) lasts at 0 and the system time (cpu sy) is twice as long as the user time (cpu us), the system faces a shortage of CPU resources.
To put it simply:
R and b are not higher than 5, and if r is often greater than 4 and id is often less than 40, then the CPU load is very heavy.
The us+sy is no more than 80%. If it is greater than 80, the process will spend waiting time in the run queue, and the response time and throughput will decrease.
Wa is no more than 25, if wa > 40 indicates that disk io does not have an unreasonable balance, or operation on disk is frequent.
In general, it is the application's problem that leads to insufficient CPU resources. For example, some unreasonable SQL statements and so on will cause this phenomenon.
Memory:
Si and so are basically zero. Where si represents the total amount of memory swapped back per second (Swap in), in units of kbytes;so, the total amount of memory swapped out per second (Swap out), in kbytes. If si,so is not equal to 0 for a long time, it means that the system uses swap frequently, that is, it is out of memory.
In general, if the memory occupancy rate is high, but when the CPU footprint is very low, it can be considered that there are a lot of applications that occupy memory and do not release it.
It is important to note that Linux memory will not be released after use, so you will generally see that the memory utilization is very high. To determine whether linux memory is normal, you need to look at the swap frequency of the swap swap area.
For the oracle video tutorial, please follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.