Linux的daemon进程对Oracle数据库的SGA使用大页内存的处理

简介: Oracle对运行在机器内存超过32G上的数据库推荐使用HugePages 来容纳Oracle数据库的SGA,参见。

大页内存管理在Oracle数据上的应用


Oracle对运行在机器内存超过32G上的数据库推荐使用HugePages 来容纳Oracle数据库的SGA,参见。

Note: 401749.1 - Shell Script to Calculate Values Recommended Linux HugePages / HugeTLB Configuration

Note: 361323.1 - HugePages on Linux: What It Is… and What It Is Not…

在linux上配置sga使用hugepage的方法参见: https://blog.csdn.net/weixin_43424368/article/details/104518609

在linux上大页管理使内存的管理单位从4K提高到2M,大大提高了系统的性能,我用swingbench测试的结果是使TPS值大约提高了10%。

配置成功后,数据库启动时在Oracle的alert log中有相应的提示,例如:

************************ Large Pages Information *******************
Per process system memlock (soft) limit = 227 GB
Total Shared Global Region in Large Pages = 190 GB (100%)
Large Pages used by this instance: 97281 (190 GB)
Large Pages unused system wide = 3 (6144 KB)
Large Pages configured system wide = 97284 (190 GB)
Large Page size = 2048 KB
********************************************************************


daemon启动Oracle数据库时SGA无法使用大页管理

在大页管理的配置中需要对Oracle的用户增加memlock的设置,但用daemon启动Oracle的数据库时用以系统服务的方式进行的,并没有配置memlock参数,因此SGA无法使用大页管理,在alert log中有下面的提示:

************************ Large Pages Information *******************
Per process system memlock (soft) limit = 64 KB
Total Shared Global Region in Large Pages = 0 KB (0%)
Large Pages used by this instance: 0 (0 KB)
Large Pages unused system wide = 97284 (190 GB)
Large Pages configured system wide = 97284 (190 GB)
Large Page size = 2048 KB
RECOMMENDATION:
  Total System Global Area size is 190 GB. For optimal performance,
  prior to the next instance restart:
  1. Large pages are automatically locked into physical memory.
 Increase the per process memlock (soft) limit to at least 190 GB to lock
 100% System Global Area's large pages into physical memory
********************************************************************


Linux已经配置了大页而Oracle的SGA没有使用的后果

如果Linux已经配置了大页而Oracle的SGA没有,那么SGA将会放在普通的内存页面,将会造成内存耗尽,实际测试中,Centos和Redhat系统处于自我保护会把Oracle进程杀掉,而Oracle的linux(Unbreakable Enterprise Linux)不会。

[oracle@localhost scott]$ dstat -mt 20
------memory-usage----- ----system----
 used  buff  cach  free|     time     
3721M 8192B 6104M 1693M|02-04 03:47:29
5018M 8192B 6146M  353M|02-04 03:47:49
5232M 8192B 6146M  140M|02-04 03:48:09
5277M 8192B 6146M 94.2M|02-04 03:48:29


解决方案

修改文件/etc/security/limits.conf进行配置对daemon是没有用的,因为这个文件是为通过PAM登录的用户设置资源限制。需要对应修改文件“/etc/init.d/daemon-agent ”,增加一行:


LimitMEMLOCK=unlimited

或者修改/usr/lib/systemd/system/daemon-agent.service


[Service]
LimitMEMLOCK=infinity
LimitNOFILE=65535


修改完,需要systemctl daemon-reload。

启动时在alert log中有下面的提示,注意memlock是unlimited。

************************ Large Pages Information *******************
Per process system memlock (soft) limit = UNLIMITED
Total Shared Global Region in Large Pages = 190 GB (100%)
Large Pages used by this instance: 97281 (190 GB)
Large Pages unused system wide = 3 (6144 KB)
Large Pages configured system wide = 97284 (190 GB)
Large Page size = 2048 KB
********************************************************************


相关文章
|
12月前
|
Oracle 关系型数据库 MySQL
Oracle Linux 8.10 编译安装sysbench
Oracle Linux 8.10 编译安装sysbench
400 34
|
11月前
|
Oracle Cloud Native 关系型数据库
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
446 11
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
|
11月前
|
Oracle Cloud Native 关系型数据库
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
469 0
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
|
10月前
|
Oracle 关系型数据库 Linux
MyEMS开源系统安装之CentOS/RHEL/Rocky/AlmaLinux/Oracle Linux
本指南介绍如何在CentOS/RHEL/Rocky/AlmaLinux/Oracle Linux服务器上部署MyEMS开源能源管理系统。内容涵盖系统准备、数据库配置、多个MyEMS服务(如myems-api、myems-admin、myems-modbus-tcp等)的安装与配置,以及Nginx服务器设置和防火墙规则调整。通过完成所有步骤,您将能够访问MyEMS Admin UI和Web UI,默认端口分别为8001和80,初始登录凭据已提供。
638 0
|
12月前
|
Oracle 关系型数据库 MySQL
Oracle linux 8 二进制安装 MySQL 8.4企业版
Oracle linux 8 二进制安装 MySQL 8.4企业版
510 1
|
Linux 数据库 Perl
【YashanDB 知识库】如何避免 yasdb 进程被 Linux OOM Killer 杀掉
本文来自YashanDB官网,探讨Linux系统中OOM Killer对数据库服务器的影响及解决方法。当内存接近耗尽时,OOM Killer会杀死占用最多内存的进程,这可能导致数据库主进程被误杀。为避免此问题,可采取两种方法:一是在OS层面关闭OOM Killer,通过修改`/etc/sysctl.conf`文件并重启生效;二是豁免数据库进程,由数据库实例用户借助`sudo`权限调整`oom_score_adj`值。这些措施有助于保护数据库进程免受系统内存管理机制的影响。
|
Linux Shell
Linux 进程前台后台切换与作业控制
进程前台/后台切换及作业控制简介: 在 Shell 中,启动的程序默认为前台进程,会占用终端直到执行完毕。例如,执行 `./shella.sh` 时,终端会被占用。为避免不便,可将命令放到后台运行,如 `./shella.sh &`,此时终端命令行立即返回,可继续输入其他命令。 常用作业控制命令: - `fg %1`:将后台作业切换到前台。 - `Ctrl + Z`:暂停前台作业并放到后台。 - `bg %1`:让暂停的后台作业继续执行。 - `kill %1`:终止后台作业。 优先级调整:
1215 5
|
Oracle 关系型数据库 Linux
linux8安装oracle 11g遇到的问题记录
Oracle 11g在Linux 8上安装时会遇到link编译环节的问题。官方建议忽略安装中的链接错误,安装完成后应用DBPSU 11.2.0.4.240716补丁及一次性补丁33991024,再重新编译二进制文件,并配置监听器和数据库。但因11g已退出服务期,这些补丁需付费获取。网上信息显示22年1月的PSU补丁也可解决问题,找到该补丁后按常规方式打补丁即可。如有需求或疑问可咨询我。
704 20
|
Oracle Cloud Native 关系型数据库
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
333 10
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
|
监控 Oracle 关系型数据库
Linux平台Oracle开机自启动设置
【11月更文挑战第8天】在 Linux 平台设置 Oracle 开机自启动有多种方法,本文以 CentOS 为例,介绍了两种常见方法:使用 `rc.local` 文件(较简单但不推荐用于生产环境)和使用 `systemd` 服务(推荐)。具体步骤包括编写启动脚本、赋予执行权限、配置 `rc.local` 或创建 `systemd` 服务单元文件,并设置开机自启动。通过 `systemd` 方式可以更好地与系统启动过程集成,更规范和可靠。
1124 2

热门文章

最新文章