关于大内存页的设置重要性不再赘述,总之为了性能着想,务必开启大内存页配置,以大大减少操作系统对于内存的管理开销成本。
本站搜索"HugePage"可查到笔者早期的博文<<linux大内存页设置>>
在19c日志里,数据库启动时,如果没有开启预期的HugePage设置,开始就会明确提出配置建议,大致内容如下所示。
2020-09-03T10:06:18.639578+08:00 Per process system memlock (soft) limit = UNLIMITED Expected per process system memlock (soft) limit to lock instance MAX SHARED GLOBAL AREA (SGA) into memory: 10G Available system pagesizes: 4K, 2048K Supported system pagesize(s): PAGESIZE AVAILABLE_PAGES EXPECTED_PAGES ALLOCATED_PAGES ERROR(s) 4K Configured 8 2621448 NONE 2048K 0 5121 0 NONE RECOMMENDATION: 1. For optimal performance, configure system with expected number of pages for every supported system pagesize prior to the next instance restart operation.
好的,看明白了,本系统页大小有两种,4K和2M,根据SGA的设置,期望的HugePage页数为5121,都不用你自己手动计算了,其实手动计算也很简单,简单的根据sga_max_size/2M+1即可。
配置/etc/security/limits.conf:
oracle soft memlock unlimited
oracle hard memlock unlimited
配置/etc/sysctl.conf
cat >> /etc/sysctl.conf << EOF
vm.nr_hugepages=5121
EOF
重启OS/DB生效
之后再检查alertlog,配置成功:
********************************************************************** 2020-09-03T11:37:36.665863+08:00 Dump of system resources acquired for SHARED GLOBAL AREA (SGA) Per process system memlock (soft) limit = UNLIMITED Expected per process system memlock (soft) limit to lock instance MAX SHARED GLOBAL AREA (SGA) into memory: 10G Available system pagesizes: 4K, 2048K Supported system pagesize(s): PAGESIZE AVAILABLE_PAGES EXPECTED_PAGES ALLOCATED_PAGES ERROR(s) 4K Configured 8 8 NONE 2048K 5121 5121 5121 NONE **********************************************************************
文章评论
查看hugepage使用情况:
grep -i page /proc/meminfo