监控工具DPA发现海外一台Oracle数据库服务器DB Commit Time指标告警,超过红色告警线(40毫秒左右,黄色告警是10毫秒,红色告警线是20毫秒),如下截图所示,生成了对应的时段的AWR报告,发现Top 5 Timed Events里面,log file sync等待事件的平均等待时间为37毫秒,log file parallel write等待事件的平均等待时间为40毫秒

如果对Tanel Poder::Understanding LGWR, Log File Sync Waits and Commit Performance这篇文章所讲述的内容很熟悉的话(经典图如下),那么通过等待事件log file sync与log file parallel write的Avg Wait(ms)指标: 37ms & 40ms,基本上可以判断就是redo log所在的磁盘I/O出现了性能问题

然后在用lfsdiag.sql脚本分析一下详细的统计数据,如下所示:

HISTOGRAM DATA FOR LFS AND OTHER RELATED WAITS:

 

APPROACH: Look at the wait distribution for log file sync waits

by looking at "wait_time_milli". Look at the high wait times then

see if you can correlate those with other related wait events.

 

   INST_ID EVENT                                    WAIT_TIME_MILLI WAIT_COUNT

---------- ---------------------------------------- --------------- ----------

         1 log file sync                                          1       4363

         1 log file sync                                          2        835

         1 log file sync                                          4       1650

         1 log file sync                                          8       4937

         1 log file sync                                         16     146252

         1 log file sync                                         32     606674

         1 log file sync                                         64     263377

         1 log file sync                                        128     253254

         1 log file sync                                        256          2

         1 log file switch completion                             1        124

         1 log file switch completion                             2          9

         1 log file switch completion                             4         19

         1 log file switch completion                             8         21

         1 log file switch completion                            16         35

         1 log file switch completion                            32         97

         1 log file switch completion                            64        133

         1 log file switch completion                           128        326

         1 log file switch completion                           256       1736

         1 log file switch completion                           512       3042

         1 log file switch completion                          1024       2020

         1 log file parallel write                                1          0

         1 log file parallel write                                2          0

         1 log file parallel write                                4         80

         1 log file parallel write                                8       2142

         1 log file parallel write                               16     170987

         1 log file parallel write                               32     779205

         1 log file parallel write                               64     311463

         1 log file parallel write                              128      79688

         1 log file parallel write                              256      42763

         1 log file parallel write                              512      13052

         1 log file parallel write                             1024      20468

         1 log file parallel write                             2048      14020

         1 log file parallel write                             4096        921

         1 log file parallel write                             8192         96

         1 log file parallel write                            16384         18

         1 log file parallel write                            32768         18

         1 log file parallel write                            65536          8

         1 log file parallel write                           131072          2

         1 LGWR wait for redo copy                                1       8516

         1 LGWR wait for redo copy                                2         20

         1 LGWR wait for redo copy                                4         19

         1 LGWR wait for redo copy                                8         20

         1 LGWR wait for redo copy                               16         11

 

ORDERED BY WAIT_TIME_MILLI

 

   INST_ID EVENT                                    WAIT_TIME_MILLI WAIT_COUNT

---------- ---------------------------------------- --------------- ----------

         1 log file sync                                          1       4363

         1 log file switch completion                             1        124

         1 log file parallel write                                1          0

         1 LGWR wait for redo copy                                1       8516

         1 log file sync                                          2        835

         1 log file switch completion                             2          9

         1 log file parallel write                                2          0

         1 LGWR wait for redo copy                                2         20

         1 log file sync                                          4       1650

         1 log file switch completion                             4         19

         1 log file parallel write                                4         80

         1 LGWR wait for redo copy                                4         19

         1 log file sync                                          8       4937

         1 log file switch completion                             8         21

         1 log file parallel write                                8       2142

         1 LGWR wait for redo copy                                8         20

         1 log file sync                                         16     146252

         1 log file switch completion                            16         35

         1 log file parallel write                               16     170987

         1 LGWR wait for redo copy                               16         11

         1 log file sync                                         32     606674

         1 log file switch completion                            32         97

         1 log file parallel write                               32     779205

         1 log file sync                                         64     263377

         1 log file switch completion                            64        133

         1 log file parallel write                               64     311463

         1 log file sync                                        128     253254

         1 log file switch completion                           128        326

         1 log file parallel write                              128      79688

         1 log file sync                                        256          2

         1 log file switch completion                           256       1736

         1 log file parallel write                              256      42763

         1 log file switch completion                           512       3042

         1 log file parallel write                              512      13052

         1 log file switch completion                          1024       2020

         1 log file parallel write                             1024      20468

         1 log file parallel write                             2048      14020

         1 log file parallel write                             4096        921

         1 log file parallel write                             8192         96

         1 log file parallel write                            16384         18

         1 log file parallel write                            32768         18

         1 log file parallel write                            65536          8

         1 log file parallel write                           131072          2

 

REDO WRITE STATS

 

"redo write time" in centiseconds (100 per second)

11.1: "redo write broadcast ack time" in centiseconds (100 per second)

11.2: "redo write broadcast ack time" in microseconds (1000 per millisecond)

 

VERSION              INST_ID NAME                                                     VALUE        MILLISECONDS

----------------- ---------- ---------------------------------------- --------------------- -------------------

10.2.0.5.0                 1 redo write time                                        9551524        95515240.000

10.2.0.5.0                 1 redo writer latching time                                   51

10.2.0.5.0                 1 redo writes                                            1434931

 

AWR WORST AVG LOG FILE SYNC SNAPS:

上面数据可以看到,log file sync等待事件数量最多的是32ms这个区间的,log file parallel write等待事件发生最多的也是32ms这个区间的,其实这个值已经远远超过7ms,极其不正常。log file parallel write 事件是LGWR进程专属的等待事件,发生在LGWR将log_buffer中的重做日志信息写入联机重做日志文件组的成员文件,LGWR在该事件上等待该写入过程的完成。该事件等待时间过长,说明日志文件所在磁盘缓慢或存在争用。log file sync和log file parallel write是相互关联的。换句话讲,假设log file parallel write的时间非常长,那么必定导致log file sync等待时间拉长。如果log file parallel write 等待非常高,那么可能一般是物理磁盘I/O的问题

另外,我们也检查了一下redo log的切换频率,如下所示,redolog_sitch_time.sql查看发现redo log切换的次数并不频繁,生成的归档日志的量也并不大。大部分时候一小时切换零次或一次。

然后我们找了一台机器(上述指标正常的服务器)简单对测试了一下IO的速度,这个方法极其简单,就是看看生成一个大文件需要多长时间,简单测试一下I/O性能(没有考虑cache等,测试采样也不详尽),但是对比数据也基本能验证、反馈磁盘IO存在问题)。

问题服务器:

# time dd if=/dev/zero of=./test bs=512k count=2048 oflag=direct

2048+0 records in

2048+0 records out

1073741824 bytes (1.1 GB) copied, 88.271 seconds, 12.2 MB/s

real    1m28.273s

user    0m0.010s

sys     0m0.655s

对比服务器(正常的服务器):

# time dd if=/dev/zero of=./test bs=512k count=2048 oflag=direct

2048+0 records in

2048+0 records out

1073741824 bytes (1.1 GB) copied, 2.48344 seconds, 432 MB/s

real    0m2.485s

user    0m0.004s

sys     0m0.386s

如上对比所示,两台服务器生成同样一个大小文件,耗费的时间,I/O性能差别非常大,完全验证了告警的服务器所在的存储I/O存在性能问题,但是公司分工非常明确,DBA也不清楚底层存储出了什么问题,只能将这个问题反馈出来,等待海外负责维护系统和存储的同事的回复。

log file sync等待超高案例浅析的更多相关文章

  1. log file sync等待超高一例

    这是3月份某客户的情况,原因是server硬件故障后进行更换之后,业务翻译偶尔出现提交缓慢的情况.我们先来看下awr的情况. 我们能够看到,该系统的load profile信息事实上并不高,每秒才21 ...

  2. 完全揭秘log file sync等待事件-转自itpub

    原贴地址:http://www.itpub.net/thread-1777234-1-1.html   谢谢 guoyJoe 老大 这里先引用一下tanel poder大师的图: 什么是log fil ...

  3. Oracle数据库由dataguard备库引起的log file sync等待

    导读: 最近数据库经常出现会话阻塞的报警,过一会又会自动消失,昨天晚上恰好发生了一次,于是赶紧进行了查看,不看不知道,一看吓一跳,发现是由dataguard引起的log file sync等待.我们知 ...

  4. RAC 性能分析 - 'log file sync' 等待事件

    简介 本文主要讨论 RAC 数据库中的'log file sync' 等待事件.RAC 数据库中的'log file sync' 等待事件要比单机数据库中的'log file sync' 等待事件复杂 ...

  5. oracle之 等待事件LOG FILE SYNC (awr)优化

    log file sycn是ORACLE里最普遍的等待事件之一,一般log file sycn的等待时间都非常短 1-5ms,不会有什么问题,但是一旦出问题,往往都比较难解决.什么时候会产生log f ...

  6. Oracle之 等待事件log file sync + log file parallel write (awr优化)

    这是3月份某客户的情况,原因是server硬件故障后进行更换之后,业务翻译偶尔出现提交缓慢的情况.我们先来看下awr的情况. 我们能够看到,该系统的load profile信息事实上并不高,每秒才21 ...

  7. log file sync 因为数据线有问题而造成高等侍的表现

    这是3月份某客户的情况,原因是服务器硬件故障后进行更换之后,业务翻译偶尔出现提交缓慢的情况.我们先来看下awr的情况. 我们可以看到,该系统的load profile信息其实并不高,每秒才21个tra ...

  8. 理解LGWR,Log File Sync Waits以及Commit的性能问题[转]

    理解LGWR,Log File Sync Waits以及Commit的性能问题 一.概要: 1.  Commit和log filesync的工作机制 2.  为什么log file wait太久 3. ...

  9. log file sync 等侍值高的一般通用解决办法

    log file sync等待时间发生在redo log从log buffer写入到log file期间. 下面对log file sync做个详细的解释. 何时发生日志写入: 1.commit或者r ...

随机推荐

  1. uglify-js 和uglify-es

    uglify-js 它不支持压缩 es6,参考github的issue It seems like uglify-js does not support es6? uglify-js在压缩代码时,遇到 ...

  2. HDU1907 Jhon

    Little John is playing very funny game with his younger brother. There is one big box filled with M& ...

  3. BX谷 2019年最新所有人都能学会的数据分析课视频教程

    第一章 数据分析师职业概览 1-1 数据分析师的职业概览免费试学 数据分析师的"钱"景如何 什么人适合学数据分析 数据分析师的临界知识 数据分析师的主要职责 第二章 数据分析和数据 ...

  4. SSM 轻量级框架构建:图书管理系统

    一.接业务,作分析 1.大致业务要求 1.1 使用 SSM( Spring MVC + Spring + MyBatis )实现图书信息管理系统, MySQL5.5 作为后台数据库,该系统包括查询图书 ...

  5. Orleans[NET Core 3.1] 学习笔记(三)( 2 )客户端配置

    客户端配置 通过一个ClientBuilder和多个补充选项类,以编程方式配置一个用于连接Silo集群并将请求发送至Grain的客户端. 客户端配置示例: var client = new Clien ...

  6. C#中关于值类型和引用类型的区别

    小声哔哔 一直以来对于值类型与引用类型之间的区别都不是特别清晰,直到踩了坑.... 正好最新闲暇,便想着梳理梳理这一两年来遇到的奇葩问题和解决方案,顺便就把它给拎出来记一下,免得以后再摔跤 值类型与引 ...

  7. 2.成产出现 max(vachar2)取值问题

    uat 测试结果正确max(9)>max(8),结果生产出现 max(9)>max(12) 原因:字符类型,默认比较第一个字符的ASCII码. 解决方式: max(to_number(va ...

  8. 11条MySQL规范,你知道的有几个?

    一.数据库命令规范 · 所有数据库对象名称必须使用小写字母并用下划线分割 · 所有数据库对象名称禁止使用mysql保留关键字(如果表名中包含关键字查询时,需要将其用单引号括起来) · 数据库对象的命名 ...

  9. C语言每日一练——第2题

    一.题目要求 已知数据文件in.dat中存有300个四位数,并调用读函数readDat()把这些数存入数组a中,请编制一函数jsValue(),其功能是:求出所有这些四位数是素数的个数cnt,再求出所 ...

  10. java基础-谈谈你对面向对象的理解

    一 前言 本篇文章的核心知识如下,主要是帮助大家更好的理解面向对象编程: 二面向对象VS面向过程 2.1 面向过程编程 面向过程编程(Process Oriented Programming )其意指 ...