[Change]pgpgin|pgpgout|pswpin|pswpout meaning and difference

Source: Internet
Author: User

pgpgin|pgpgout|pswpin|pswpout meaning and difference

Quoted from: http://ssms.cs2c.com.cn/otrs/pc.pl?Action=PublicFAQZoom;ItemID=11741

Transferred from: http://www.cnblogs.com/york-hust/p/4810906.html

The main meaning of the article is:

1. Page in/out action refers to reading the pages in a block device into memory or writing a page in memory to a block device

When the ever program or the data needs to being accessed and is the read in from the IT permanent location on disk, the is called a page I N Request. When the ever program or the data needs to be saved and are written to a permanent location on disk, this is the called a page out requ Est.

2. Pages in page In/out refer to disk sector, size 512 bytes instead of 4k size pages in virtual memory

The kernel tracks each disk page (512b) of read in within the Pgpgin (pages paged in) counter

3. Pgpgin/pgpgout refers to the number of page in/out between main memory and block device (hard disk).

These counters is related to virtual memory "paging" only in the fact that they is doing disk IO to load a memory page W ITH data from disk or write the data from a memory page back to disk

4. Pswpin/pswpout refers to the number of pages in virtual memory that are read/read from the swap area of the block device. Therefore, it is included in the Pgpgin/pgpgout.

Pages swapped in or out be also counted within pages paged in or out respectively since swap Io is still ultimately block Device based.

-------------------------------------------Gorgeous split-line----------------------------------------------------------to improve disk access efficiency , Linux has done some careful design, in addition to caching the Dentry (for VFS, accelerating file path name to Inode conversion), there are two main cache methods: Buffer cache and Page cache. The former is for disk block read and write, The latter is read and write to the file inode. These caches effectively shorten the time for I/O system calls (such as read,write,getdents).

Memory activity can basically be quantified with 3 numbers: Total active virtual memory, exchange (swapping) rate and paging (paging) rate. The first number indicates the total memory demand, and the last two numbers indicate how much of the memory is in use. The goal is to reduce memory activity or increase the amount Until the paging rate remains at an acceptable level.

Total Active virtual memory (VM) = actual memory size (size of real memories) (physical memory) + Swap space Used (amount of swap spaces used)

When the program needs more memory than the physical memory, the UNIX system uses paging mechanism, that is, the system copy some in-memory pages to disk, freeing up space for the process to use.
Most systems can tolerate occasional paging, but frequent paging can drastically degrade system performance.

UNIX Memory Management: The UNIX system uses 2 methods for memory management, "paging algorithm", "Switching technology".
Paging algorithm is to swap the most recently used pages in memory to disk, and keep the Frequently used pages (active pages) in memory for the process to use.
Switching technology is the system that swaps the entire process, not part of the page, to the disk. Under normal circumstances, some exchange processes occur.
When memory is critically low, paging and swapping are used frequently, which increases the load on disk I/O. It further reduces the execution speed of the system to the job, that is, the system I/O resource problem will affect the allocation of memory resources.

Virtual Memory for UNIX

Unix virtual memory is a very complex subsystem, it realizes the transparency of inter-process code and data sharing mechanism, and can allocate more memory than the system's existing physical memory, some operating system virtual storage can even affect the performance of the file system by providing caching function. UNIX implementations of various styles differ greatly in the way they are implemented, but are inseparable from the following 4 concepts.

1: Actual memory
Actual memory refers to the physical memory that is actually present in a system, called RAM. Real memory is the fastest and most efficient way to store temporary data, so it must be distributed to the application as much as possible, and there are now several forms of RAM: SIMM, DIMM, Rambus, DDR, and many more RAM can use error correction mechanism (ECC).

2: Swap Space
Swap space is a piece of disk space dedicated to temporarily storing memory, typically used when paging and exchanging process data, and it is generally recommended that the swap space should be two to four times times the size of physical memory.

3: Page Scheduling
Page scheduling refers to the transfer of data from disk to memory, and the reverse process, which is called page scheduling, because UNIX memory is divided evenly into pages of equal size, usually with a page size of 4KB and 8KB (which can be viewed in Solaris with the PageSize command). When an executable program starts running, its image is swapped out of the disk on a page-by-page, similar to when some memory is idle for a period of time, it can be swapped out into the swap space, so that the free RAM can be given to other programs that need it to use.

4: Exchange
Page scheduling is usually easy to confuse with the concept of swapping, which refers to the transfer of an idle portion of a process's memory to disk, whereas swapping refers to transferring the entire process to disk when the actual memory in the system is not enough to meet the new allocation requirements, which usually means that the swap activity is low on memory.

Vmstat Monitoring memory Performance: This command is used to check the statistics of virtual memory and to display information about process status, idle and swap space, paging, disk space, CPU load and exchange, cache refreshes, and interrupts.




Procs

R:the number of processes waiting for run time.
The number of processes running and waiting (CPU time slices) to run, this value can also determine whether the CPU needs to be increased (longer than 1)

B:the number of processes in uninterruptable sleep.
The number of processes in a non-interruptible state, which is usually caused by IO

W:the number of processes swapped out but otherwise runnable.

Memory

Swpd:the amount of virtual memory used (KB).

Free:the amount of idle memory (KB).
Free physical Memory

Buff:the amount of memory used as buffers (KB).
Buffers the memory of the buffer cache, buffering the read and write of the block device

Cache:the amount of memory used as cache.

Swap

Si:amount of memory swapped in from disk (KB/S). Page import of virtual memory (import RAM from swap disk)

So:amount of memory swapped to disk (KB/S). Page export of virtual memory (from RAM to SWAP DISK)


[Change]pgpgin|pgpgout|pswpin|pswpout meaning and difference

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.