570375 - SAP on Oracle Solaris - Swap Space and Paging

3
5/23/2018 570375-SAPonOracleSolaris-SwapSpaceandPaging-slidepdf.com http://slidepdf.com/reader/full/570375-sap-on-oracle-solaris-swap-space-and-paging SAP Note Header Data Symptom Description of swap space and paging for Solaris Other Terms Swap Space Paging Memory Sun Solaris Reason and Prerequisites Questions about the required swap space and the maximum acceptable paging activity for Oracle Solaris Solution This note discusses the basic principles of the Solaris memory subsystem. It also explains how to detect memory bottlenecks and lack of virtual memory. 1. The basic principles of the Solaris memory architecture One fundamental principle is that the file system cache and the virtual memory system are integrated. Thus, the file system uses free physical memory just as processes when requesting memory. As a consequence, high values in the columns pi (page in) or po (page out) alone does not mean that there is a memory bottleneck. Another principle of the Solaris memory architecture is the dynamically allocated space for the file system cache. The file system cache increases and shrinks automatically on demand, depending on certain boundary conditions. When the amount of free physical memory is low, a kernel thread called "page scanner" is activated and checks which physical memory pages have been used recently and marks pages that can be paged out and later these pages are paged out to the swap device. The rate at which the page scanner is looking for pages to page out is the "scan rate" (column sr in vmstat). Oracle Solaris ensures that file system cache pages are freed before process pages are paged out. In case paging out pages to the swap device does not lead to less than 2 processes in the run queue, more free memory, and low pi+po rates, Solaris will swap out complete processes until the situation gets better. This is only a short overview for better understanding the Solaris memory architecture and the detection of a memory bottleneck. For further reading, please refer to the book "Solaris Internals" written by Richard Mc Dougall and Jim Mauro. 2. How to detect and solve a memory (performance) bottleneck Detecting and solving a memory (performance) bottleneck typically consists of the following steps: 1. Identify the swap devices using the commands swap -l and, depending on the file systems you have configured on the server, zpool status -v , metastat, and/or vxprint -ht. 2. Using iostat (e.g. iostat -xpnC 10) or sar, look if there is a high amount of I/O on these disks/volumes. 3. Check if the columns pi, po and sr of vmstat show values greater than 0 for a longer time, e.g. for several minutes. Column pi shows pages paged in (disk->RAM), po shows pages paged out (RAM->disk), and sr displays the scan rate. Scan rates of more than 500 over a longer time will most likely occur together with a lot of I/O on the swap volumes. 4. If condition 2 AND 3 are true, we can assume a memory bottleneck. This is especially true if the values discussed in 2 and 3 increase over time. 5. In SAP, you will likely detect increased processing time (gap between avg. response time and the other measured times). If the memory bottleneck is on the database server, you will see longer db request times in the SAP monitors. 6. The memory (performance) bottleneck can be solved by reducing the amount of memory consumed by the applications or by adding more physical memory (RAM). 3. How to detect and solve a lack of virtual memory 570375 - SAP on Oracle Solaris: Swap Space and Paging Version 3 Validity:  13.05.2014 - active Language English (Master) Released On 14.05.2014 15:00:34 Release Status Released for Customer Component BC-OP-SUN SUN Solaris Priority Recommendations / Additional Info Category Performance

description

570375 - SAP on Oracle Solaris - Swap Space and Paging

Transcript of 570375 - SAP on Oracle Solaris - Swap Space and Paging

  • SAP Note

    Header Data

    Symptom

    Description of swap space and paging for Solaris

    Other Terms

    Swap Space Paging Memory Sun Solaris

    Reason and Prerequisites

    Questions about the required swap space and the maximum acceptable paging activity for Oracle Solaris

    Solution

    This note discusses the basic principles of the Solaris memory subsystem. It also explains how to detect memory bottlenecks and lack of virtual memory.

    1. The basic principles of the Solaris memory architecture One fundamental principle is that the file system cache and the virtual memory system are integrated. Thus, the file system uses free physical memory just as processes when requesting memory. As a consequence, high values in the columns pi (page in) or po (page out) alone does not mean that there is a memory bottleneck. Another principle of the Solaris memory architecture is the dynamically allocated space for the file system cache. The file system cache increases and shrinks automatically on demand, depending on certain boundary conditions. When the amount of free physical memory is low, a kernel thread called "page scanner" is activated and checks which physical memory pages have been used recently and marks pages that can be paged out and later these pages are paged out to the swap device. The rate at which the page scanner is looking for pages to page out is the "scan rate" (column sr in vmstat). Oracle Solaris ensures that file system cache pages are freed before process pages are paged out. In case paging out pages to the swap device does not lead to less than 2 processes in the run queue, more free memory, and low pi+po rates, Solaris will swap out complete processes until the situation gets better. This is only a short overview for better understanding the Solaris memory architecture and the detection of a memory bottleneck. For further reading, please refer to the book "Solaris Internals" written by Richard Mc Dougall and Jim Mauro.

    2. How to detect and solve a memory (performance) bottleneck Detecting and solving a memory (performance) bottleneck typically consists of the following steps: 1. Identify the swap devices using the commands swap -l and, depending on the file systems you

    have configured on the server,zpool status -v, metastat, and/or vxprint -ht. 2. Using iostat (e.g. iostat -xpnC 10) or sar, look if there is a high amount of I/O on these

    disks/volumes. 3. Check if the columns pi, po and sr of vmstat show values greater than 0 for a longer time,

    e.g. for several minutes. Column pi shows pages paged in (disk->RAM), po shows pages paged out (RAM->disk), and srdisplays the scan rate. Scan rates of more than 500 over a longer time will most likely occur together with a lot of I/O on the swap volumes.

    4. Ifcondition 2 AND3 are true, we can assume a memory bottleneck. This is especially true ifthe values discussed in 2 and3 increase over time.

    5. In SAP, you will likely detect increased processing time (gap between avg. response time and the other measured times). If the memory bottleneck is on the database server, you will see longer db request times in the SAP monitors.

    6. The memory (performance) bottleneck can be solved by reducing the amount of memory consumed by the applications or by adding more physical memory (RAM).

    3. How to detect and solve a lack of virtual memory

    570375 - SAP on Oracle Solaris: Swap Space and Paging

    Version 3 Validity: 13.05.2014 - active Language English (Master)

    Released On 14.05.2014 15:00:34 Release Status Released for Customer Component BC-OP-SUN SUN Solaris Priority Recommendations / Additional Info Category Performance

  • Check if the 4th column of the vmstat command (memory->swap) shows low values over a longer period of time. In such a case, the amount of configured swap space plus RAM is too low to satisfy the memory requests of the applications running on that server. You should then take measures to reduce the memory consumption of the applications running on your system. Youcan use the command prstat -s size to identify other applications which consume a high amount of memory. For SAP, ordering an EarlyWatch session or examining ST02 and ST03, memory profile, should be done to see if the memory consumption can be reduced. Adding more swap space may help in those cases where the memory consumption cannot be reduced significantly and there is no need for high performance during the times of high memory consumption. In other cases, most likely only more physical memory will help.

    Validity

    This document is not restricted to a software component or software component version

    References

    This document refers to:

    SAP Notes

    This document is referenced by:

    SAP Notes (5)

    1404134 Compilation fails with memory issue in Web service component 397521 SAP Software Installation: not enough swap space 153641 Swap space requirement for R/3 64-bit kernel 146289 Parameter Recommendations for 64-Bit SAP Kernel 124199 ST06 display - Paged in [Kb/h] / Paged out [Kb/h] 103747 Performance: Parameter recommendations as of Release 4.0

    63906 Explanation for SWAP SPACE sizes in ST06 21960 Several instances/systems on one UNIX computer

    21960 Several instances/systems on one UNIX computer 153641 Swap space requirement for R/3 64-bit kernel 146289 Parameter Recommendations for 64-Bit SAP Kernel 63906 Explanation for SWAP SPACE sizes in ST06 1404134 Compilation fails with memory issue in Web service component