Linux hugepage configuration-optimizing oracle memory

Source: Internet
Author: User

Linux hugepage configuration-optimizing oracle memory linux is not as powerful as aix and hp unix, but linux is also very good. To improve linux performance, it uses a lot of io, memory scheduling mechanism. linux uses the memory mode by vm, that is, linux virtualizes the physical memory and swap into memory for external provision. Sometimes users may seem to use the memory, but actually it is a disk. How can we avoid using the swap disk space? In linux, the unit of memory management is pages, usually 4 K pages. When we use large memory (> 8 GB ), the management of such a large memory will cause a great burden on the system, coupled with frequent pagein/pageout, will become the bottleneck of the system. 1. hugepage Introduction 2. practice configuration 1. hugepage introduction hugepage was introduced in linux2.6 kernel, mainly providing 4 K page and relatively large page selection. When we access the memory, we first access the "page table", linux then accesses the real physical memory (ram + swap) through the page ing of "page table ). To improve performance, linux applies for a fixed buffer size in the cpu, which is called TLB. TLB contains part of the "page table" content, which also follows, keep data as close as possible to the cpu principle. In TLB, hugetlb is used to point to hugepage. The allocated hugepage is provided to the process as the memory file system hugetlbfs (similar to tmpfs. When a 4 k page is used to enable hugepage for a linux system, hugepage is assigned and retained without pagein/pageout unless human intervention is performed, such as modifying the hugepage configuration; according to the Linux kernel version and HW architecture, the size of hugepage ranges from 2 MB to MB. The use of large pages also reduces the management pressure on TLB and page tables. Why is hugepage used for large memory (> 8 GB ), hugepage is very helpful for improving oracle performance in linux. 1) Larger Page Size and Less of Pages: reduces the workload of HugeTLB. 2) No Page Table Lookups: because hugepage is not swappable, there is no page table lookups. 3) No Swapping: in Linux, hugepage does not support swapping 4) No 'kswapd 'Operations: in linux, the process "kswapd" manages swap. If it is large memory, the number of pages is very large, so "kswapd" will be called frequently, which will affect the performance. 1) Before configuration, [oracle @ db101 ~] $ Grep HugePages/proc/meminfoHugePages_Total: 0HugePages_Free: 0HugePages_Rsvd: 0 Hugepagesize: 2048 kB (2) First modify limits. conf [root @ db101 ~] # Vi/etc/security/limits. conf # equal to SGA_MAX_SIZE, the following is KB locked for 15 GB memory # zengmuansha add 0122 oracle soft memlock 15826672 oracle hard memlock 15826672 (3) [ORACLE 11G] must disable AMM (Automatic Memory Management) feature to use hugepage to SET the following initialization parameters: alter system set sga_max_size = 15455 m scope = SPFILE; alter system set sga_target = 0 SCOPE = SPFILE; alter system set PGA_AGGREGATE_TARGET = 2048 m scope = SPFILE; alter system set memory_target = 0 SCOPE = SPFILE; ALTER SYS Tem set memory_max_target = 0 SCOPE = SPFILE; (4) calculate the number of hugepages allocated to nr_hugepages: nr_hugepages> = sga (mb)/Hugepagesize (mb) echo "vm. nr_hugepages = 3872 ">/etc/sysctl. conf (5) Restart system reboot (6) Start database sqlplus/as sysbastartup (7) Check if it takes effect root @ db101: [/root] grep HugePages/proc/meminfoHugePages_Total: 3890HugePages_Free: 17HugePages_Rsvd: 0 to ensure the validity of the HugePages configuration, the HugePages_Free value should be less than the value of HugePages_Total, and should be equal to HugePages _ The value of Rsvd. The value of Hugepages_Free and HugePages_Rsvd should be smaller than the gages allocated by SGA. 2.8 troubleshooting common problems: Symptom Possible CauseTroubleshooting ActionSystem is running out of memory or swapping Not enough HugePages to cover the SGA (s) and therefore the area reserved for HugePages are wasted where SGAs are allocated through regular pages Review your HugePages configuration to make sure that all SGA (s) are covered. databases fail to startmemlock limits are not set properlyMake sure the settings in limits. conf apply to database owner account. one of the database fail to start while another is upThe SGA of the specific database cocould not find available HugePages and remaining RAM is not enough. make sure that the RAM and HugePages are enough to cover all your database SGAsCluster Ready Services (CRS) fail to startHugePages configured too large (maybe larger than installed RAM) make sure the total SGA is less than the installed RAM and re-calculate HugePages. hugePages_Total = HugePages_FreeHugePages are not used at all. no database instances are up or using AMM. disable AMM and make sure that the database instances are up. database started successfully and the performance is slowThe SGA of the specific database cocould not find available HugePages and therefore the SGA is handled by regular pages, which leads to slow performanceMake sure that the HugePages are covered enough to cover all your database SGAs
 

Related Article

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.