Vmstatvmstat, a server performance debugging tool, is a very useful Linux system monitoring tool. you can use the vmstat command to obtain information about processes, memory, memory paging, IO blocking, traps, and CPU activity. 1. the preface clearly shows from the name that vmstat is a query... vmstat, a server performance debugging tool, is a very useful tool for Linux system monitoring. the vmstat command can be used to obtain information about processes, memory, memory paging, blocking IO, traps, and CPU activities. I. preface it is clear from the name that we can know that vmstat is a tool for viewing Virtual Memory usage. but how can we identify bottlenecks in the system through vmstat? Before answering this question, let's review the virtual memory related content in Linux. II. Virtual memory running principle every process running in the system needs to use the memory, but not every process needs to use the memory space allocated by the system every moment. When the memory required to run the system exceeds the actual physical memory, the kernel will release some or all of the physical memory occupied by some processes, store this part of data on the disk until the next Call of the process, and provide the released memory to the process in need. In Linux memory management, the above memory scheduling is mainly completed through "page Paging" and "Swapping switching. The paging algorithm is used to change pages that are not frequently used in the memory to disks and keep the active pages in the memory for the process to use. The switching technology is to swap the entire process, not some pages, to the disk. The Page writing process is called Page-Out, and the Page re-returning from the disk to the memory is called Page-In. When the kernel requires a Page but finds that this Page is not in the physical memory (because it has already been Page-Out), a Page error (Page Fault) occurs ). When the system kernel finds that the amount of memory that can run is low, it releases some physical memory through Page-Out. Page-Out management does not occur frequently. However, if Page-out occurs frequently until the kernel management Page time exceeds the running program time, the system performance decreases sharply. At this time, the system is running very slowly or in the paused state, which is also called thrashing ). III. use vmstat 1. usage: vmstat [-a] [-n] [-S unit] [delay [count] vmstat [-s] [-n] [-S unit] vmstat [-m] [-n] [delay [count] vmstat [-d] [-n] [delay [count] vmstat [-p disk partition] [-n] [delay [count] vmstat [-f] vmstat [-V]-: show active and inactive memory-f: displays the number of Forks since system startup. -M: Display slabinfo-n: the name of each field is displayed only once at the beginning. -S: displays memory-related statistics and the number of various system activities. Delay: refresh interval. If this parameter is not specified, only one result is displayed. Count: Number of refreshes. If you do not specify the number of refreshes, but specify the interval, the number of refreshes is infinite. -D: displays disk statistics. -P: displays statistics of specified disk partitions.-S: displays statistics in a specified unit. Parameters include k, K, m, and M, representing 1000, 1024, 1000000, and 1048576 bytes respectively ). The default unit is K (1024 bytes)-V: displays vmstat version information.
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.