Linux系统下快速配置系统下快速配置HugePages的完整步骤的完整步骤
主要给大家介绍了关于如何在Linux系统下快速配置HugePages的完整步骤,文中通过图文介绍的非常详细,对
大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
前言前言
关于Linux系统的HugePages与Oracle数据库优化,可以参考熊爷之前的文章,相关概念介绍的非常清晰:
Linux大内存页Oracle数据库优化
本文旨在Linux系统上快速配置HugePages
测试环境:RHEL6.8 + 512G物理内存;Oracle 11.2.0.4 SGA=400G.
1.设置设置memlock无限制无限制
在/etc/security/limits.conf配置文件中,设置oracle用户memlock无限制:
vi /etc/security/limits.conf
oracle soft memlock unlimited
oracle hard memlock unlimited
2.设置合理的设置合理的vm.nr_hugepages
在/etc/sysctl.conf配置文件中,设置合理的vm.nr_hugepages值。
运行MOS 401749.1提供的hugepages_settings.sh脚本,直接可以得到建议值。
hugepages_settings.sh脚本内容:
#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
# on Oracle Linux
#
# 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.
#
# This script is provided by Doc ID 401749.1 from My Oracle Support
# http://support.oracle.com
# Welcome text
echo "
This script is provided by Doc ID 401749.1 from My Oracle Support
(http://support.oracle.com) where it is intended to compute values for
the recommended HugePages/HugeTLB configuration for the current shared
memory segments on Oracle Linux. Before proceeding with the execution please note following:
* For ASM instance, it needs to configure ASMM instead of AMM.
* The 'pga_aggregate_target' is outside the SGA and
you should accommodate this while calculating SGA size.
* In case you changes the DB SGA size,
as the new SGA will not fit in the previous HugePages configuration,
it had better disable the whole HugePages,
start the DB with new SGA size and run the script again.
And make sure that:
* Oracle Database instance(s) are up and running
* Oracle Database 11g Automatic Memory Management (AMM) is not setup
(See Doc ID 749851.1)
* The shared memory segments can be listed by command:
# ipcs -m
Press Enter to proceed..."
read
# Check for the kernel version
KERN=`uname -r | awk -F. '{ printf("%d.%d",$1,$2); }'`
# Find out the HugePage size
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`