禁用ASMM 后就可以配置HugePages,步骤如下.
1.配置memlock
Edit the memlock setting in the /etc/security/limits.conf file. The memlock setting is specified in KB and set slightly lesser than the installed RAM. For example, if you have 64GB RAM installed, add the following entries to increase the max locked memory limit:
* soft memlock 60397977
* hard memlock 60397977
You can also set the memlock value higher than your SGA requirements.
2.查看memlock
Login as the oracle user again and run the ulimit -l command to verify the new memlock setting:
$ ulimit -l
60397977
3.查看当前hugepagesize
Run the following command to display the value of Hugepagesize variable:
$ grep Hugepagesize /proc/meminfo
4.计划hugepages值
Complete the following procedure to create a script that computes recommended values for hugepages configuration for the current shared memory segments:
Linux 7.x 中 Oracle hugepage 大页配置脚本
https://www.cndba.cn/dave/article/2672
Run the following command to change the permission of the file:
$ chmod +x hugepages_settings.sh
Run the hugepages_settings.sh script to compute the values for hugepages configuration:
$ ./hugepages_settings.sh
5.设置/etc/sysctl.conf 参数
Set the following kernel parameter:
# sysctl -w vm.nr_hugepages=value_displayed_in_step_5
To make the value of the parameter available for every time you restart the computer, edit the /etc/sysctl.conf file and add the following entry:
vm.nr_hugepages=value_displayed_in_step_5
6.重启操作系统
Restart the server.
7.验证hugepage
To check the available hugepages, run the following command:
$ grep Huge /proc/meminfo
HugePages_Total: 9732 == vm.nr_hugepages 参数值