LINUX view current system memory usage Vmstat

Source: Internet
Author: User
Tags memory usage cpu usage

Linux vmstat Commands

The Vmstat command is the most common Linux/unix monitoring tool that can represent the state values of a server at a given time interval , including the server's CPU usage, memory usage, virtual memory exchange situation , IO Read and write situations.

compared to top, I can see the CPU, memory , and IO usage of the whole machine, instead of just seeing the CPU of each process usage and Memory utilization ( different scenarios ) .

> Vmstat

[Email protected] ~]$ Vmstat

procs-----------Memory-------------Swap-------io------System-------CPU-----

R b swpd free buff cache si so bi bo in CS us sy ID WA St

0 0 0 323208 290276 5500528 0 0 0 2 0 0 0 0 100 0 0

The use of general andVmstat Tools is accomplished by two parameters,

The first parameter is the time sampled, the unit is seconds, and the number of times the second sample

> Vmstat 2 1 // indicates: every two seconds, the server state is collected once

[Email protected] ~]$ Vmstat 2 1

procs-----------Memory-------------Swap-------io------System-------CPU-----

R b swpd free buff cache si so bi bo in CS us sy ID WA St

0 0 0 323084 290276 5500528 0 0 0 2 0 0 0 0 100 0 0

The actual project, we generally in a period of time has been monitoring, do not want to monitor, the direct end of OK;

> Vmstat 2 // indicates that data is collected every two seconds and collected (until the program is actively closed)

[Email protected] ~]$ Vmstat 2

procs-----------Memory-------------Swap-------io------System-------CPU-----

R b swpd free buff cache si so bi bo in CS us sy ID WA St

0 0 0 323208 290276 5500528 0 0 0 2 0 0 0 0 100 0 0

0 0 0 323192 290276 5500528 0 0 0 0 248 341 0 0 100 0 0

0 0 0 323192 290276 5500528 0 0 0 0 225 333 0 0 100 0 0

2 0 0 323192 290276 5500528 0 0 0 0 225 332 0 0 100 0 0

^c

The specific, each parameter represents the content as follows:

R

Indicates the running queue;

when this value exceeds the CPU number, there will be CPU bottlenecks;

general load more than 3 high, more than 5 are relatively high, more than ten are not normal, the server is more dangerous;

the load on top is similar to the queue running per second. If the queue is too large, it indicates that the CPU is busy,

B

Represents a blocked process,

Swpd

Represents the size of virtual memory usage

if it is greater than 0, indicates that the machine is out of physical memory, if it is not the cause of the memory leak, it should upgrade the memory, or migrate the memory;

Free

Indicates the size of free memory

Buff

It is used to store the contents of the directory, permissions and other caches;

Cache

indicates the size of the cache, cache is used directly to record our open files, file caching;

(Take a portion of the free physical memory to the cache of files and directories, improving the performance of the program execution)

(When the program uses memory,Buff/cache will be used quickly)

Si

Indicates the size of the virtual memory read from disk per second;

If this value is greater than 0, it means that the physical memory is not enough or the memory leaks, to find out the memory process;

So

Indicates the size of virtual memory written to disk per second;

Bi

Indicates the number of blocks received per second by the block device;

The block device here refers to all the disks and other block devices on the system;

Bo

Indicates the number of blocks sent per second by the block device;

For example, if we read the file,Bo will be greater than 0. Bi and Bo are generally close to 0, otherwise the IO is too frequent and needs to be adjusted.

Inch

represents per second The number of interrupts, including time interruption, of the CPU;

Cs

represents the context per second number of switches,

When invoking the system function, it is necessary to switch the context, the switch of the thread, and the process context.

The smaller the value, the better, too big, consider the number of threads or processes to be lowered;

us

represents a user CPU time,

Sy

represents the System CPU time;

If it is too high, it indicates a long system call time

ID

indicates idle CPU time;

General ID + US + sy = 100

can be understood as:ID is idle CPU usage, US is the user CPU utilization, SY is the system CPU utilization;

Wt

indicates waiting IO, CPU time;

LINUX view current system memory usage Vmstat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.