System performance monitoring Tool-free

Source: Internet
Author: User

[Email protected] ~]# free [-b|-k|-m|-g] [-t]
Parameters:

-B Displays memory usage in bytes.
-K displays memory usage in kilobytes.
-m displays memory usage in megabytes.
-G displays memory usage in gigabytes.
-O does not display buffer throttling columns.
-s< interval seconds > Continuous observation of memory usage.
-T displays the memory sum column.
-V Displays version information.

Example one: Displays the current system's memory capacity, in megabytes
[Email protected] ~]# free-m
Total used free shared buffers Cached
mem:376 366 10 0 129 94
-/+ buffers/cache:141 235
swap:996 0 995

Free Output parsing:

Mem: Indicates physical memory statistics

-/+ Buffers/cache: Cache statistics representing physical memory

(Note: The memory currently available to the system is not the value of the first row of free1 tags, it represents only the memory that has not been allocated.) And should be the value of the second line free2 tag)

Swap: Indicates the use of swap partitions on the hard disk, used, idle swap

1) The difference between buffers and cached
A buffer is something that have yet to being "written" to disk. A cache is something that have been "read" from the disk and stored for later use
For applications, buffers/cached is equal to available, because buffer/cached is designed to improve the performance of file reads, and buffer/cached is quickly recycled when applications need to use memory. So from the application's point of view: Available memory = System Free Memories + buffers + cached, which is the value of free2 above.
Buffers is the buffer size used to make a block device, and he only records the metadata of the filesystem and tracking in-flight pages. Cached is used to buffer files. That is to say: buffers is used to store, and cached is directly used to remember the file we open, if you want to know if he is really effective, you can try, successively executed two times the command #man X, you can obviously feel the second time the speed of a lot faster.

2) brief description of Swap
When the available memory is less than the rated value, the Exchange begins.
How to see rated Value (RHEL4.0): #cat/proc/meminfo

The exchange will reduce the number of physical pages used in the system in three ways:
1) Reduce the buffer and the size of the page cache,
2) Swap out the memory page of the System V type
3) Swap out or discard the page. (Application occupies a memory page, that is, insufficient physical memory).
The small amount of swap use does not affect the performance of the system. In general, swap is best not to be used, especially swap is best not to be used more than 20% or more, because swap efficiency and physical memory is much worse, and the system will use swap, because the physical memory is not enough to do so.

3) Use the free command
Subtracting the values of buffer and cache from the value of used is your current real memory usage. Buffer/cached is designed to improve the performance of program execution, and buffer/cached is quickly used when the program uses memory. So, to the application point of view, with (-/+ Buffers/cache) of the free and used-based, so we look at this is good.

Other common sense, Linux in order to improve disk and memory access efficiency, Linux has done a lot of careful design, in addition to the Dentry cache (for the VFS, accelerated file path name to Inode conversion), but also adopted two main cache mode: Buffer Cache and Page cache. The former is for the disk block read and write, the latter for the file inode read and write. These caches can effectively shorten the time for I/O system calls (such as read,write,getdents). Remember that the memory is for use, not to take a look. Unlike windows, no matter how much of your real physical memory, he will have to take the hard disk swap files to read. This is why Windows often prompts for a lack of virtual space. You think, how boring, in memory and most of the time, take out some of the hard disk space to act as memory. How fast the hard drive is faster than memory. So we look at Linux, as long as no swap swap space, there is no need to worry about their memory too little. If you often use a lot of swap, you might want to consider adding physical memory. This is also the standard for Linux to see if memory is adequate.

System performance monitoring Tool-free

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.