热门标签 | HotTags
当前位置:  开发笔记 > 运维 > 正文

AIX6.1/11.2.0.3数据库上关于SWAP的一个BUG

昨天去南京某客户那里调优新上线的业务数据库,在查看alert.log日志时发现在过去的一段时间里,每过几个小时或间隔一段时间,就会报类以下的内容:ThuAug2109:01:262014WARNING:Heavyswappingobservedonsysteminlast5mins.pctofmemoryswappe

昨天去南京某客户那里调优新上线的业务数据库,在查看alert.log日志时发现在过去的一段时间里,每过几个小时或间隔一段时间,就会报类以下的内容: Thu Aug 21 09:01:26 2014WARNING: Heavy swapping observed on system in last 5 mins.pct of memory swappe

昨天去南京某客户那里调优新上线的业务数据库,在查看alert.log日志时发现在过去的一段时间里,每过几个小时或间隔一段时间,就会报类似以下的内容:
Thu Aug 21 09:01:26 2014 WARNING: Heavy swapping observed on system in last 5 mins. pct of memory swapped in [8.42%] pct of memory swapped out [2.16%]. Please make sure there is no memory pressure and the SGA and PGA are configured correctly. Look at DBRM trace file for more details.
Thu Aug 21 14:56:27 2014 WARNING: Heavy swapping observed on system in last 5 mins. pct of memory swapped in [5.40%] pct of memory swapped out [8.63%]. Please make sure there is no memory pressure and the SGA and PGA are configured correctly. Look at DBRM trace file for more details.
......
Sat Oct 18 22:13:48 2014 WARNING: Heavy swapping observed on system in last 5 mins. pct of memory swapped in [7.76%] pct of memory swapped out [0.33%]. Please make sure there is no memory pressure and the SGA and PGA are configured correctly. Look at DBRM trace file for more details.
客户的环境是IBM P570,AIX 6.1,安装了Oracle 11.2.0.3单实例数据库,物理内存64G,仅仅分配了20G给SGA,采用memory自动管理
查阅了一下MOS,发现是AIX平台上的一个bug,相关文档为:[1508575.1]
对应的数据库和平台:
Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.3 [Release 11.2] IBM AIX on POWER Systems (64-bit)
症状:

There is new warning message in alert.log in 11.2.0.3 similar to

WARNING: Heavy swapping observed on system in last 5 mins.
pct of memory swapped in [2.08%] pct of memory swapped out [0.12%].
Please make sure there is no memory pressure and the SGA and PGA
are configured correctly. Look at DBRM trace file for more details.

On AIX platform this message can be seen even when there is no virtual memory swapping at all. --物理内存足够,而且根本没有使用swap交换空间

You may compare the vmstat from AIX level with DBRM trace file entries to see the differences.


原因:

The issue is caused by unpublished Bug:14731911.

Swap usage messages are based on statistics that do not reflect the actual usage.

The v$osstat does not reflect proper stats for the swap space paging.

解决方法:

Apply Patch:11801934 on top of your IBM AIX on POWER Systems (64-bit) platform.

P.S: Bug is port-specific. --这个bug是针对端口指定的平台的

The issue is fixed in patchset 11.2.0.4 and release 12.1. --说是在12.1的patch中修复了,但实际上12.1还是会有这个问题,会有ora-700错误,详见文档:[ID 1919850.1]

来看一下BUG:14731911的描述:

Bug 属性


B - Defect
2 - Severe Loss of Service 11.2.0.3
96 - Closed, Duplicate Bug 212 - IBM AIX on POWER Systems (64-bit)
2012-10-8
2014-10-11 11801934
11.2.0.3 Port-Specific
Oracle 与此 Bug 相关的知识, 补丁程序和 Bug
\

相关产品


Oracle Database Products Oracle Database Suite
Oracle Database 5 - Oracle Database - Enterprise Edition
\
Hdr: 14731911 11.2.0.3 RDBMS 11.2.0.3 VOS PRODID-5 PORTID-212 11801934
Abstract: FALSE SWAP WARNING MESSAGES PRINTED TO ALERT.LOG ON AIX
 
*** 10/08/12 04:52 am ***
  
  
  BUG TYPE CHOSEN
  ===============
  Code
  
  SubComponent: Virtual Operating System
  ======================================
  DETAILED PROBLEM DESCRIPTION
  ============================
  Oracle process seems to check wrong OS local statistic (which include also
  FILESYSTEM caching etc.)
  
  Alert log shows WARNING: Heavy swapping observed on system in last 5 mins.
  pct of memory swapped in [2.08%] pct of memory swapped out [0.12%].
  Please make sure there is no memory pressure and the SGA and PGA 
  are configured correctly. Look at DBRM trace file for more details.
  
  but this is not reflected at OS level.
  
  DIAGNOSTIC ANALYSIS
  ===================
  1. nmon shows virtual memory swapping does not occur at all - see attached file --nmon根本没有监控到swap动作
  
  2. Oracle Database Server is 11.2.0.3 and contains fix for 10220118
  
  3. Server configuration
  real mem: 144GB
  lowest value of fre memory : 87,65 GB --剩余内存充足
  
  4. DBRM seems to use a wrong OS statistics - trace file is attached
  
  WORKAROUND?
  ===========
  No
  
  TECHNICAL IMPACT
  ================
  Wrong diagnostic analyze.
  Message is bothering customer's DBA when in fact the warning message is
  misleading
  
  RELATED ISSUES (bugs, forums, RFAs)
  ===================================
  http://myforums.oracle.com/jive3/thread.jspa?threadID=1104581 
  10220118
  
  HOW OFTEN DOES THE ISSUE REPRODUCE AT CUSTOMER SITE?
  ====================================================
  Always
  
  DOES THE ISSUE REPRODUCE INTERNALLY?
  ====================================
  No
  
  EXPLAIN WHY THE ISSUE WAS NOT TESTED INTERNALLY.
  ================================================
  Unavailable Data Volume
  
  IS A TESTCASE AVAILABLE?
  ========================
  No
  
  Link to IPS Package:
  ====================
  not available

DBRM(Database Resource Manager)是11gR2中新特性中出现的后台进程,会在alert.log告警日志中反映OS操作系统最近5分钟是否有剧烈的swap活动,而在AIX平台上,由于BUG:14731911的存在,oracle的这个进程谎报了内存进行了swapin和swapout动作。我们知道,只有当物理内存真的不够用的情况下,才会去用swap(通常会配置成物理内存的2倍),而swap是非常耗费性能的(从物理磁盘读写)。但是个人认为这个bug的危害性并不大,仅仅只是在alert.log日志中报了一个WARNING,并没有因为这个影响导致对数据库更加负面的影响,因此是否打补丁到11.2.0.4就见仁见智了,如果想让alert.log平安无事,那么就可以升级一下patch。当然了,如果真的是因为OS内存吃紧造成的swap动作,就要区别对待了,因为此时的确会对数据库造成严重影响。要区分是否真的内存不足而非系统误报,那么主要还是通过nmon,topas,vmstat等监控工具来进行分析(linux下还可以用free监控)

对于AIX平台,其实还有另一个bug,只不过是unpublished base bug,而不是port-specific bug

AIX Platform

If your Platform is IBM-AIX then this is not the only possible reason for this alert log message.
For IBM AIX on POWER Systems (64-bit), there is also next known port-specific bug:
Bug 14731911 - FALSE SWAP WARNING MESSAGES PRINTED TO ALERT.LOG ON AIX
with unpublished base bug:
Bug 11801934 : WRONG PAGE-IN AND PAGE-OUT OS VM STATS IN AIX.

在vmware平台中的这个WARNING信息,如果不是bug引起,则很有可能和ora-04031/ora-04030相关,这个就严重多了

VMWare

Under VMWare, the messages may perhaps indicate a more serious issue, even when no memory related ORA-4031/ORA-4030 errors are reported.
Under circumstances, an instance in a virtual machine may be simply terminated by PMON due to error 471 without further errors in the alert log.
The OS logs may in such case report an out of memory condition like below:

[root@vmh ~]# grep Kill /var/log/messages*
/var/log/messages-20140629:Jun 27 18:29:06 vmh-msfc-dodp02 kernel: [1895074.304941] Out of memory: Kill process 42094 (oracle) score 391 or sacrifice child
/var/log/messages-20140629:Jun 27 18:29:06 vmh-msfc-dodp02 kernel: [1895074.305203] Killed process 42094, UID 303, (oracle) total-vm:189081588kB, anon-rss:27412kB, file-rss:109612

通常解决OS内存swap问题有以下几种方案:

1. 诊断是否存在内存泄露的进程,解决内存泄露 2. 调优SGA/PGA,减少oracle对内存的占用 3. 利用/proc/sys/vm/drop_caches,暂时释放一些cache的内存(Linux) 4. 调整系统VM内存管理参数, 例如Linux上sysctl.conf中的以下几个参数:


vm.min_free_kbytes:Raising the value in /proc/sys/vm/min_free_kbytes will cause the system to start reclaiming memory at an earlier time than it would have before.

vm.vfs_cache_pressure:At the default value of vfs_cache_pressure = 100 the kernel will attempt to reclaim dentries and inodes at a “fair” rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes.


vm.swappiness:default 60,Apparently /proc/sys/vm/swappiness on Red Hat Linux allows the admin to tune how aggressively the kernel swaps out processes'memory. Decreasing the swappiness setting may result in improved Directory performance as the kernel holds more of the server process in memory longer before swapping it out.

设置以下值,以减少OOM(Out Of Memory)的可能性:

# Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
vm.min_free_kbytes = 51200
vm.swappiness = 40
vm.vfs_cache_pressure = 200



推荐阅读
  • 在日常运维中,频繁地对多台Linux服务器进行用户管理是一项耗时的任务。为了提高效率,可以通过编写Expect脚本来实现远程自动化操作,从而简化这一过程。 ... [详细]
  • 一键LNMP配置SSL证书实现全站HTTPS访问
    许多网站搭建者选择了便捷的一键LNMP安装包,但在网站部署完成后,配置SSL证书以支持HTTPS访问是一个不可或缺的步骤。本文将详细介绍如何通过简单的步骤完成这一过程。 ... [详细]
  • 本文概述了在GNU/Linux系统中,动态库在链接和运行阶段的搜索路径及其指定方法,包括通过编译时参数、环境变量及系统配置文件等方式来控制动态库的查找路径。 ... [详细]
  • 本文概述了作者在2014年的几项目标与愿望,包括职业发展、个人成长及家庭幸福等方面的具体计划。 ... [详细]
  • Linux系统中的USB驱动架构
    USB系统采用了树状拓扑结构,其主机端和设备端分别配置了主机控制器(Host Controller)和USB设备控制器(USB Device Controller)。主机控制器负责整个USB系统的通信调度,确保数据的有效传输。 ... [详细]
  • 本文探讨了在使用 MyBatis 进行批量数据处理时遇到的参数绑定异常问题,并提供了详细的解决方案。 ... [详细]
  • 本文详细介绍了如何在Windows和Linux系统上配置Openfire服务器,包括安装步骤、数据库配置及端口映射等关键环节。 ... [详细]
  • 本文详细介绍了如何使用Linux下的mysqlshow命令来查询MySQL数据库的相关信息,包括数据库、表以及字段的详情。通过本文的学习,读者可以掌握mysqlshow命令的基本语法及其常用选项。 ... [详细]
  • 本文定期更新,涵盖虚拟化技术的基础知识、Xen虚拟机架构详解、KVM架构与原理、QEMU模拟器的功能及使用方法。同时,文章还探讨了不同虚拟化技术之间的比较与联系,以及如何利用这些技术进行网络配置和虚拟磁盘管理。 ... [详细]
  • Java高级工程师学习路径及面试准备指南
    本文基于一位朋友的PDF面试经验整理,涵盖了Java高级工程师所需掌握的核心知识点,包括数据结构与算法、计算机网络、数据库、操作系统等多个方面,并提供了详细的参考资料和学习建议。 ... [详细]
  • 本文详细介绍了如何在PHP中使用Memcached进行数据缓存,包括服务器连接、数据操作、高级功能等。 ... [详细]
  • Linux内核中的内存反碎片技术解析
    本文深入探讨了Linux内核中实现的内存反碎片技术,包括其历史发展、关键概念如虚拟可移动区域以及具体的内存碎片整理策略。旨在为开发者提供全面的技术理解。 ... [详细]
  • 本文详细介绍了在 Linux Bash 环境下使用的各种快捷键,包括命令编辑、控制、历史命令重用及特殊命令等,帮助用户提高操作效率。 ... [详细]
  • 如何高效学习鸿蒙操作系统:开发者指南
    本文探讨了开发者如何更有效地学习鸿蒙操作系统,提供了来自行业专家的建议,包括系统化学习方法、职业规划建议以及具体的开发技巧。 ... [详细]
  • Java中提取字符串的最后一部分
    本文介绍了如何使用Java中的substring()和split()方法来提取字符串的最后一部分,特别是在处理包含特殊字符的路径时的方法与技巧。 ... [详细]
author-avatar
2012-蜕变_502
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有