Home > Workload Solutions > Oracle > Guides > Design Guide—Modernize Your Oracle Database Server Platform and Accelerate Deployments > Red Hat OS and VMware configuration best practices
The baseline configuration for the Red Hat operation system configuration is based on the default kernel configuration with updates to the Oracle 19c database pre-install RPM (oracle-database-preinstall-19c-1.0-1.el8.x86_64.rpm). Install the Oracle 19c database pre-install RPM to the database server before the Oracle database software installation. These settings are also included in our baseline configuration for the Red Hat operating system configuration.
From this baseline, we added a Dell customer Oracle profile and enabled Hugepages. Use the following steps to do this:
We created a custom tuned profile for Oracle workloads on Dell infrastructure called dell_oracle_oltp that supports Oracle databases using the following steps:
#tuned-adm profile dell_oracle_oltp
#tuned-adm active
By installing the dell_oracle_oltp, Transparent HugePages will be disabled, and the following settings are added into the /etc/sysctl.conf as indicated in the [sysctl] sections of the tuned.conf file shown in Figure 22.
Enable HugePages using the following steps:
1. Run the following command to determine if the kernel supports HugePages:
$ grep Huge /proc/meminfo
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
2. Edit memlock setting in etc/security/limits.conf. The memlock setting value is specified in KB, and the maximum locked memory limit should be set to at least 90 percent of the current RAM when HugePages memory is enabled. For example, if the server RAM size is 128GB, the memlock can be set 128GB * 90% = 120,795,955 KB. Add the following lines into this file:
* soft memlock 120,795,955
* hard memlock 120,795,955
3. Log in as and Oracle user and run the following ulimit -l
command to verify the new memlock
setting:
$ ulimit -l
120795955
4. Get the HugePage size by running this command:
$ grep Hugepagesize /proc/meminfo
5. Create a script hugepages_settings.sh that computes recommended values for HugePages
configuration for the current shared memory segments:
!/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 {'print $2'}`
# 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 {'print $5'} | grep "[0-9][0-9]*"`
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'|'3.8') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
*) echo "Unrecognized kernel version $KERN. Exiting." ;;
esac
# End
6. Perform the permission of this script
$chmod +x hugepages_settings.sh
7. Perform this script to values for hugepages configuration:
$./hugepages_settings.sh
8. Set the following kernel parameter, where value is the HugePages value that you determined in step 6:
# sysctl -w vm.nr_hugepages=value
9. Check the available HugePages:
$grep Huge /proc/meminfo
10. Restart the database instance and run the command to check the available hugepages
$grep Huge /proc/meminfo