由一条日志警告所做的调优分析

简介: 这个案例发生有段时间了,但是今天无意中看到当时的邮件,感觉还是收益匪浅,看来还是细节决定成败啊。从一些日志或trace 文件中的警告信息中我们可以发掘出潜在的问题。
这个案例发生有段时间了,但是今天无意中看到当时的邮件,感觉还是收益匪浅,看来还是细节决定成败啊。从一些日志或trace 文件中的警告信息中我们可以发掘出潜在的问题。
当时系统中的用户数很小,所以每天都能抽时间看看日志记录,看有没有明显的问题。结果在grep的时候发现trace文件中有一些警告记录。
当时的库是10gR2的库,现在已经升级到了11gR2.
/xxxx/oracle/xxxxx/oradmp/udump/xxxxx01_ora_15070.trc 
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production 
With the Partitioning, OLAP, Data Mining and Real Application Testing options 
ORACLE_HOME = /opt/app/oracle/xxxxxx/product/10.2.0 
System name:    Linux 
Node name:      xxxx 
Release:        2.6.18-308.el5 
Version:        #1 SMP Fri Jan 27 17:17:51 EST 2012 
Machine:        x86_64 
Instance name: xxxxxx
Redo thread mounted by this instance: 1 
Oracle process number: 472 
Unix process pid: 15070, image: oracle@xxxxx (TNS V1-V3) 
 
*** 2013-03-29 20:18:54.711 
*** ACTION NAME:() 2013-03-29 20:18:54.707 
*** MODULE NAME:(OGG-ECC_ARCG-GLOPEN_DATA_SOURCE) 2013-03-29 20:18:54.707 
*** SERVICE NAME:(SYS$USERS) 2013-03-29 20:18:54.707 
*** SESSION ID:(5029.3122) 2013-03-29 20:18:54.707 
WARNING:Could not increase the asynch I/O limit to 224 for SQL direct I/O. It is set to 128 
WARNING:Could not increase the asynch I/O limit to 256 for SQL direct I/O. It is set to 128 
WARNING:Could not increase the asynch I/O limit to 224 for SQL direct I/O. It is set to 128 
*** 2013-03-29 22:25:26.506 
WARNING:Could not increase the asynch I/O limit to 224 for SQL direct I/O. It is set to 128 
WARNING:Could not increase the asynch I/O limit to 256 for SQL direct I/O. It is set to 128 
WARNING:Could not increase the asynch I/O limit to 256 for SQL direct I/O. It is set to 128 
WARNING:Could not increase the asynch I/O limit to 288 for SQL direct I/O. It is set to 128 

从警告的信息可以看出,和IO相关,可能是什么参数的设置出问题了。查看MOS 发现有一篇相关的文章。
Warning:Could Not Increase The Asynch I/O Limit To XX For Sql Direct I/O (Doc ID 1302633.1)
其中给出的solution如下:
[root@xyz ~]# cat /proc/sys/fs/aio-max-nr
65536

SOLUTION

The aio-max-size kernel parameter doesn't exist in the 2.6.x Linux kernels. 
This feature is now "automatic" in the 2.6.x kernel, based on the physical capabilities of the disk device driver.
This should mean that the Linux Kernel is ready to perform ASYNC I/O.

All install requirements should be met.

To ensure ASYNC I/O can be performed by Oracle Database you need to verify or set the following parameters in the Database:

sql> alter system set disk_asynch_io=true scope=spfile;
sql> alter system set filesystemio_options=setall scope=spfile;

Then shutdown and startup the database and check if the warning reappears.
An HCVE report (refer to Note 250262.1) should report no remaining issues

If the above doesn't resolve the problem, then increase fs.aio-max-nr

关于查看aio的内容可以使用如下的方式来查看。
cat /proc/sys/fs/aio-max-nr
/sbin/sysctl  -a |grep aio
当时得到的值是
fs.aio-max-nr = 65536
fs.aio-nr = 65472

可能一般来说问题处理到这个地方就告一段落了。
这个问题当时是叫给一个资深的专家来做的调优,他又要了一些其他的信息。
最后给出的建议如下:
-          Increase fs.aio-max-nr  as advised in my initial e-mail to  3145728
-          Change Oracle filesystemio_options to  “SETALL”  (enable both asynch and direct IO)
 
Following is suggested:
-          VXFS – change mount options to:
mincache=direct,convosync=direct   (Must be done along with the change of the Oracle filesystemio_options)
-          Enable ODM
Pending upon the VXFS version – and True VXFS license supporting ODM (should be by default with VXFS 5.X)
Enable Veritas ODM  - by doing “ln –s /opt/VRTSodm/lib64/libodm.so   $ORACLE_HOME/lib/libodm10.so”
-          Memory
As server has sufficient memory – consult with DBAs if it is worthwhile increasing Oracle cache
-          Power
Consider disabling power management savings for better response / latency (BIOS level)
-          Disable C-State
RH 5.X do not support C-State  (BIOS level)
 
Kernel parameters:
vm.min_free_kbytes = 32768
vm.dirty_expire_centisecs = 500
vm.dirty_ratio = 15
vm.dirty_writeback_centisecs = 100
vm.swappiness = 0
vm.hugetlb_shm_group = vm.nr_hugepages = 16384      # set hugepages to 32 GB  - if total of Oracle instances cache grows beyond must increase it accordingly it is 2 MB pages)
                                                    # any increase requires a reboot !!

其中关于huge page的部分还是有点意思。其中关于设置的Hugepage数还可以通过一个脚本来计算。
当时看得云里雾里,详细的学习了一下关于hugepage的设置,还是有所收获。
其实在官方文档中已经有详细的描述。hugepage的配置可以参考文档。
http://docs.oracle.com/cd/E11882_01/server.112/e10839/appi_vlm.htm#UNXAR396
发现官方文档还是很有权威性和价值的。
计算hugepage的脚本如下:
#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
#
# 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.
# Check for the kernel version
KERN=`uname -r | awk -F. '{ printf("%d.%d\n",$1,$2); }'`
# Find out the HugePage size
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk {'print $2'}`
# Start from 1 pages to be on the safe side and guarantee 1 free HugePage
NUM_PG=1
# Cumulative number of pages required to handle the running shared memory segments
for SEG_BYTES in `ipcs -m | awk {'print $5'} | grep "[0-9][0-9]*"`
do
   MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`
   if [ $MIN_PG -gt 0 ]; then
      NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q`
   fi
done
# Finish with results
case $KERN in
   '2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;
          echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;
   '2.6') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    *) echo "Unrecognized kernel version $KERN. Exiting." ;;
esac
# End


所以问题的分析和解决思路还是最重要的,可能大多数时候碰到问题都是头疼医头,脚疼医脚。处理问题还是没有从整体的情况来做,以点带面,能够举一反三才是问题处理的高手。
相关实践学习
【涂鸦即艺术】基于云应用开发平台CAP部署AI实时生图绘板
【涂鸦即艺术】基于云应用开发平台CAP部署AI实时生图绘板
目录
相关文章
|
存储 运维 监控
SelectDB 实现日志高效存储与实时分析,完成任务可领取积分、餐具套装/水杯/帆布包!
SelectDB 实现日志高效存储与实时分析,完成任务可领取积分、餐具套装/水杯/帆布包!
|
SQL 监控 数据挖掘
SLS 重磅升级:超大规模数据实现完全精确分析
SLS 全新推出的「SQL 完全精确」模式,通过“限”与“换”的策略切换,在快速分析与精确计算之间实现平衡,满足用户对于超大数据规模分析结果精确的刚性需求。标志着其在超大规模日志数据分析领域再次迈出了重要的一步。
1249 118
|
监控 安全 搜索推荐
使用EventLog Analyzer进行日志取证分析
EventLog Analyzer助力企业通过集中采集、归档与分析系统日志及syslog,快速构建“数字犯罪现场”,精准追溯安全事件根源。其强大搜索功能可秒级定位入侵时间、人员与路径,生成合规与取证报表,确保日志安全防篡改,大幅提升调查效率,为执法提供有力证据支持。
453 0
|
监控 安全 NoSQL
【DevOps】Logstash详解:高效日志管理与分析工具
Logstash是ELK Stack核心组件之一,具备强大的日志收集、处理与转发能力。它支持多种数据来源,提供灵活的过滤、转换机制,并可通过插件扩展功能,广泛应用于系统日志分析、性能优化及安全合规等领域,是现代日志管理的关键工具。
1718 0
|
自然语言处理 监控 安全
阿里云发布可观测MCP!支持自然语言查询和分析多模态日志
阿里云可观测官方发布了Observable MCP Server,提供了一系列访问阿里云可观测各产品的工具能力,包含阿里云日志服务SLS、阿里云应用实时监控服务ARMS等,支持用户通过自然语言形式查询
2186 0
阿里云发布可观测MCP!支持自然语言查询和分析多模态日志
|
存储 消息中间件 缓存
MiniMax GenAI 可观测性分析 :基于阿里云 SelectDB 构建 PB 级别日志系统
基于阿里云SelectDB,MiniMax构建了覆盖国内及海外业务的日志可观测中台,总体数据规模超过数PB,日均新增日志写入量达数百TB。系统在P95分位查询场景下的响应时间小于3秒,峰值时刻实现了超过10GB/s的读写吞吐。通过存算分离、高压缩比算法和单副本热缓存等技术手段,MiniMax在优化性能的同时显著降低了建设成本,计算资源用量降低40%,热数据存储用量降低50%,为未来业务的高速发展和技术演进奠定了坚实基础。
832 1
MiniMax GenAI 可观测性分析 :基于阿里云 SelectDB 构建 PB 级别日志系统
|
人工智能 运维 监控
Aipy实战:分析apache2日志中的网站攻击痕迹
Apache2日志系统灵活且信息全面,但安全分析、实时分析和合规性审计存在较高技术门槛。为降低难度,可借助AI工具如aipy高效分析日志,快速发现攻击痕迹并提供反制措施。通过结合AI与学习技术知识,新手运维人员能更轻松掌握复杂日志分析任务,提升工作效率与技能水平。
|
机器学习/深度学习 人工智能 运维
智能日志分析:用AI点亮运维的未来
智能日志分析:用AI点亮运维的未来
5033 15
|
SQL 存储 自然语言处理
让跨 project 联查更轻松,SLS StoreView 查询和分析实践
让跨 project 联查更轻松,SLS StoreView 查询和分析实践
400 1
|
SQL 分布式计算 Serverless
基于阿里云 EMR Serverless Spark 版快速搭建OSS日志分析应用
基于阿里云 EMR Serverless Spark 版快速搭建OSS日志分析应用
491 0