Huge pages linux oracle
Administrator’s Solutions Guide
- Preface
- The Unbreakable Enterprise Kernel
- About the Unbreakable Enterprise Kernel
- About UEK Release 1
- About UEK Release 2
- About UEK Release 3
- About UEK Release 4
- About Yum
- About ULN
- Yum Configuration
- Configuring Use of a Proxy Server
- Yum Repository Configuration
- Downloading the Oracle Linux Yum Server Repository Files
- Using Yum Utilities to Manage Configuration
- Overview of Oracle Ksplice
- Supported Kernels
- About Ksplice Updates
- Patching and Updating Your System
- About the Ksplice Enhanced Client
- About the Ksplice Uptrack Client
- About the Btrfs File System
- Creating a Btrfs File System
- Modifying a Btrfs File System
- Compressing and Defragmenting a Btrfs File System
- Resizing a Btrfs File System
- Creating Subvolumes and Snapshots
- Cloning Virtual Machine Images and Linux Containers
- Using Send/Receive to Implement Incremental Backups
- Converting a Non-root File System
- Converting the root File System
- Mounting the Image of the Original File System
- Deleting the Snapshot of the Original File System
- Recovering an Original Non-root File System
- Setting up a New NFS Server
- Configuring an Existing NFS Server
- Setting up a New HTTP Server
- Configuring an Existing HTTP Server
- Setting up a Network Installation Server
- Installing from a Network Installation Server
- About the Installation root File System
- Creating Snapshots of the root File System
- Mounting Alternate Snapshots as the root File System
- Deleting Snapshots of the root File System
- About the XFS File System
- About External XFS Journals
- About XFS Write Barriers
- About Lazy Counters
- Setting Project Quotas
- About OCFS2
- Installing and Configuring OCFS2
- Preparing a Cluster for OCFS2
- Configuring the Firewall
- Configuring the Cluster Software
- Creating the Configuration File for the Cluster Stack
- Configuring the Cluster Stack
- Configuring the Kernel for Cluster Operation
- Starting and Stopping the Cluster Stack
- Creating OCFS2 volumes
- Mounting OCFS2 Volumes
- Querying and Changing Volume Parameters
- Recommended Tools for Debugging
- Mounting the debugfs File System
- Configuring OCFS2 Tracing
- Debugging File System Locks
- Configuring the Behavior of Fenced Nodes
- Load Balancing
- Oracle Real Application Cluster (RAC)
- Oracle Databases
- About cgroups
- Subsystems
- blkio Parameters
- cpu Parameters
- cpuacct Parameters
- cpuset Parameters
- devices Parameters
- freezer Parameter
- memory Parameters
- net_cls Parameter
- Pinning Processes to CPU Cores
- Controlling CPU and Memory Usage
- Restricting Access to Devices
- Throttling I/O Bandwidth
- About Linux Containers
- Supported Oracle Linux Container Versions
- Installing and Configuring the Software
- Setting up the File System for the Containers
- Creating and Starting a Container
- About the lxc-oracle Template Script
- About Veth and Macvlan
- Modifying a Container to Use Macvlan
- Modifying a Container to Use a Static IP Address
- About HugePages
- Configuring HugePages for Oracle Database
- For More Information About HugePages
- About kexec
- Setting up Fast Reboots of the Current Kernel
- Controlling Fast Reboots
- For More Information About kexec
- About DTrace
- Installing and Configuring DTrace
- Changing the Mode of the DTrace Helper Device
- Loading DTrace Kernel Modules
- Probe Clauses
- Pragmas
- Global Variables
- Predicates
- Scalar Arrays and Associative Arrays
- Pointers and External Variables
- Address Spaces
- Thread-local Variables
- Speculations
- Aggregations
- Examining the Stack Trace of a User-Space Application
- About sosreport
- Configuring and Using sosreport
- Configuring and Using Kdump
- Files Used by Kdump
- Installing OSWbb
- Running OSWbb
The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.9.2 Configuring HugePages for Oracle Database
The steps in this section are for configuring HugePages on a 64-bit Oracle Linux system running one or more Oracle Database instances.
- Verify that the soft and hard values in kilobytes of memlock that are configured in /etc/security/limits.conf are slightly smaller than the amount of installed memory. For example, if the system has 64GB of RAM, the values shown here would be appropriate:
soft memlock 60397977 hard memlock 60397977
$
ulimit -l
60397977SQL>
alter system set memory_target=0;
System altered. SQL>alter system set memory_max_target=0;
System altered.If you start the Oracle Database instances with a text initialization parameter file, manually edit the file so that it contains the following entries:
memory_target = 0 memory_max_target = 0
#!/bin/bash # # hugepages_settings.sh # # Linux bash script to compute values for the # recommended HugePages/HugeTLB configuration # # Note: This script does calculation for all shared memory # segments available when the script is run, no matter it # is an Oracle RDBMS shared memory segment or not. # Check for the kernel version KERN=`uname -r | awk -F. '< printf("%d.%d\n",$1,$2); >'` # Find out the HugePage size HPG_SZ=`grep Hugepagesize /proc/meminfo | awk ` # Start from 1 pages to be on the safe side and guarantee 1 free HugePage NUM_PG=1 # Cumulative number of pages required to handle the running shared memory segments for SEG_BYTES in `ipcs -m | awk | grep "47*"` do MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q` if [ $MIN_PG -gt 0 ]; then NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q` fi done # Finish with results case $KERN in '2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`; echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;; '2.6') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;; *) echo "Unrecognized kernel version $KERN. Exiting." ;; esac # End
$
chmod u+x ./hugepages_setting.sh
$./hugepages_settings.sh
. . . Recommended setting: vm.nr_hugepages = 22960After rebooting the system, verify that the database instances (including any ASM instances) have started, and use the following command to display the state of the huge pages.
#
grep ^Huge /proc/meminfo
HugePages_Total: 22960 HugePages_Free: 2056 HugePages_Rsvd: 2016 HugePages_Surp: 0 Hugepagesize: 2048 kBThe value of HugePages_Free should be smaller than that of HugePages_Total , and the value of HugePages_Rsvd should be greater than zero. As the database instances allocate pages dynamically and proactively as required, the sum of the Hugepages_Free and HugePages_Rsvd values is likely to be smaller than the total SGA size.
If you subsequenty change the amount of system memory, add or remove any database instances, or change the size of the SGA for a database instance, use hugepages_settings.sh to recalculate the value of vm.nr_hugepages , readjust the setting in /etc/sysctl.conf , and reboot the system.
Copyright © 2012, 2021, Oracle and/or its affiliates. Legal Notices
- About the Unbreakable Enterprise Kernel