"Essays" Memory & I/O detection related

Source: Internet
Author: User

  Missing pages Interrupt

A missing pages interrupt is an internal interrupt, which is an exception. Subdivision of the word belongs to the fault in the anomaly.

When executing an instruction, if it is found that the page he wants to access is not in memory (there is a bit of 0), then stop the execution of the instruction, and produce a page no exception, the corresponding fault handler can be loaded from the external memory loading the page to the memory method to troubleshoot, after the original caused by the exception of the instructions can continue to execute, And no more exceptions are generated.

Main fault--interrupts to read data from disk

The interrupt that occurs when the data has been read into memory and cached, from the memory buffer instead of reading the data directly from the hard disk

The time command can be used to see how many main page faults and secondary page faults were generated when a program first started:

/usr/bin/time-v Date

  

  Buffer and Cache

Can be used to view the server's physical memory and file cache conditions:

  

which

Memtotal--Physical total memory

Memfree--Free memory

Buffers--Disk cache

Cached--File buffers

Disk caching (buffers), also known as disk cache, is actually the data that is downloaded to the system is stored in the software allocated memory space (this memory space is called "Memory Pool"), and when the data saved to the memory pool reaches a level, the data is saved to the hard disk. This reduces the actual disk operation, effectively protecting the disk from duplication of read and write operations, resulting in damage.

File buffer (Cached), which caches file-related data in a file buffer so that it is called when needed

Reading a page from a file buffer is much faster than reading a page in the hard disk, so the Linux kernel will try to invoke a secondary page fault to read the data directly from the file buffer, rather than read it through the primary page break, so that when the system has been running for some time, it may find that even a few processes are running. The file buffers are still getting larger, and some pages are freed through the daemon only if the physical memory is not enough to be used. So when it comes to discovering the amount of memory available in the system, it may be that the kernel caches the data to the file buffer.

  Memory page Type

There are three main types of memory pages in Linux:

1. Read pages, read pages (or code pages), those pages that are interrupted from the hard drive through the main page, including static files, executables, library files, etc. that cannot be modified. When the kernel needs them to read them into memory, when the memory is low, the kernel frees them to the free list, and when the program needs them again, it needs to read the memory again through the fault pages.

2. Dirty pages, dirty pages, refers to data pages that have been modified in memory, such as text files. These files are synchronized to the hard disk by Pdflush, and the data is written back to the hard disk and the memory is freed by KSWAPD and Pdflush when the memory is low.

3. Anonymous pages, anonymous pages, which belong to a process but are not associated with any files, can not be synced to the hard disk, when the memory is insufficient, the KSWAPD is responsible for writing them to the swap partition and freeing the memory.

  Swap swap partition

Swap devices are used when the system does not have enough physical memory to handle all requests, a swap device can be a file, or it can be a disk partition. But be careful, the cost of using swap is very high. If the system does not have physical memory available, it will be frequently swapping, if the swap device and the program is about to access the data on the same file system, it will encounter serious IO problems, eventually causing the whole system to slow down, or even crash.

The swapping state between swap devices and memory is an important reference for determining the performance of Linux systems, and we can use many tools to monitor swap and swapping situations, such as top, Cat/proc/meminfo, Vmstat, and so on.

"Essays" Memory & I/O detection related

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.