[20161228]奇怪log file sync等待事件.txt

简介: [20161228]奇怪log file sync等待事件.txt --这个来自链接:http://www.itpub.net/thread-2073857-1-1.html的讨论,很奇怪的问题: Top 10 Foreground Events by Total...

[20161228]奇怪log file sync等待事件.txt

--这个来自链接:http://www.itpub.net/thread-2073857-1-1.html的讨论,很奇怪的问题:

Top 10 Foreground Events by Total Wait Time
Event                                              Waits    Total Wait Time (sec)    Wait Avg(ms)    % DB time    Wait Class
log file sync                                      47,412    50K                      1054            68.2        Commit
DB CPU                                                      7250.1                                     9.9    
log file switch (private strand flush incomplete)    420    5179.7                    12333            7.1        Configuration
enq: TX - row lock contention                         46    4448.1                    96698            6.1        application
JS kgl get object wait                             3,814    1366                        358            1.9        Administrative
JS kill job wait                                   1,269    1278.1                     1007            1.7        Administrative
SQL*Net message from dblink                      286,374    602.3                         2             .8        Network
direct path write temp                            30,149    405.4                        13             .6        User I/O
buffer busy waits                                    302    376.2                      1246             .5        Concurrency
db file sequential read                           49,254    301.4                         6             .4        User I/O

--30分钟awr报表,log file sync 达到了50K sec,一般出现这个多数情况是存放redo磁盘IO很慢,或者事务非常多.硬件不堪重负.
--而仔细看db file sequential read 平均等待事件仅仅6ms,而且lz介绍数据文件与redo在同一个磁盘组.

--而看前面Load Profile

Load Profile

                 Per Second    Per Transaction    Per Exec    Per Call
DB Time(s):            36.7                1.4    0.04        0.02
DB CPU(s):              3.6                0.1    0.00        0.00
Redo size (bytes):    164,938.0        6,263.7         

--平均每秒的redo size仅仅160K.这样的量对于现在的磁盘轻松应付.而再仔细看Background Wait Events:

Background Wait Events

    ordered by wait time desc, waits desc (idle events last)
    Only events with Total Wait Time (s) >= .001 are shown
    %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0

Event                     Waits    %Time -outs    Total Wait Time (s)    Avg wait (ms)    Waits /txn    % bg time
LNS wait on SENDREQ       21,345             0                 1,826               86           0.41    37.53
LGWR-LNS wait on channel 116,328            93                 1,647               14           2.21    33.86
log file parallel write   13,220             0                   263               20           0.25    5.40

--//前面2者相加,占用大约70%的后台时间.而这个数值几乎与log file sync占用的db time 68.2% ,相互呼应.
--而dg的参数如下:

log_archive_dest_2    service="XXXX1", LGWR SYNC AFFIRM delay=0 optional compression=disable max_failure=0
max_connections=1 reopen=300 db_unique_name="XXXX1" net_timeout=30, valid_for=(all_logfiles, primary_role)
SERVICE="XXXX1" LGWR ASYNC valid_for=(all_logfiles, primary_role) DB_UNIQUE_NAME="XXXX1"

--//前面是sync,后面是async,估计应该sync.可以推测这个设置导致出现log file sync.
--//检查oracle相关文档:http://docs.oracle.com/cd/E11882_01/server.112/e41134/log_arch_dest_param.htm#SBYDB01114

SYNC and ASYNC

Specifies whether the synchronous (SYNC) or asynchronous (ASYNC) redo transport mode is to be used.

Usage Notes

The LOG_ARCHIVE_DEST_11 through LOG_ARCHIVE_DEST_31 parameters do not support the SYNC attribute.

The redo data generated by a transaction must have been received by every enabled destination that has the SYNC
attribute before that transaction can commit.

The redo data generated by a transaction need not have been received at a destination that has the ASYNC attribute
before that transaction can commit. This is the default behavior if neither SYNC or ASYNC is specified.

--//英文我就不翻译了,我估计应该是对方的网络问题导致这个问题,目前仅仅是猜测,等待对方的确认.

相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
目录
相关文章
|
5月前
如何关掉Parsed mapper file日志打印
如何关掉Parsed mapper file日志打印
89 1
|
4月前
|
运维 应用服务中间件 网络安全
利于群晖的File Station+SFTP实现第三方人员快速获取服务器应用日志
利于群晖的File Station+SFTP实现第三方人员快速获取服务器应用日志
102 0
|
7月前
|
关系型数据库 MySQL 数据库
阿里云Mysql数据库物理全备文件恢复到自建数据库Mysql报错:InnoDB: Log file ./...xtrabacku
阿里云Mysql数据库物理全备文件恢复到自建数据库Mysql报错:InnoDB: Log file ./...xtrabacku
|
8月前
|
应用服务中间件 PHP nginx
PHP ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)
PHP ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)
56 1
|
9月前
|
Java
成功解决:ERROR StatusLogger No log4j2 configuration file found.
成功解决:ERROR StatusLogger No log4j2 configuration file found.
|
12月前
|
Oracle 前端开发 关系型数据库
log file sync 和 log file parallel write等待事件的区别和联系
log file parallel write 和log file sync这两个等待事件关系密切,很多人对这两个等待事件有一些误解,我们先来看看Oracle官方文档的解释:
|
6天前
|
C++
JNI Log 日志输出
JNI Log 日志输出
14 1
|
6天前
|
存储 运维 大数据
聊聊日志硬扫描,阿里 Log Scan 的设计与实践
泛日志(Log/Trace/Metric)是大数据的重要组成,伴随着每一年业务峰值的新脉冲,日志数据量在快速增长。同时,业务数字化运营、软件可观测性等浪潮又在对日志的存储、计算提出更高的要求。
|
12天前
|
XML Java Maven
Springboot整合与使用log4j2日志框架【详解版】
该文介绍了如何在Spring Boot中切换默认的LogBack日志系统至Log4j2。首先,需要在Maven依赖中排除`spring-boot-starter-logging`并引入`spring-boot-starter-log4j2`。其次,创建`log4j2-spring.xml`配置文件放在`src/main/resources`下,配置包括控制台和文件的日志输出、日志格式和文件切分策略。此外,可通过在不同环境的`application.yml`中指定不同的log4j2配置文件。最后,文章提到通过示例代码解释了日志格式中的各种占位符含义。
|
13天前
|
运维 监控 Go
Golang深入浅出之-Go语言中的日志记录:log与logrus库
【4月更文挑战第27天】本文比较了Go语言中标准库`log`与第三方库`logrus`的日志功能。`log`简单但不支持日志级别配置和多样化格式,而`logrus`提供更丰富的功能,如日志级别控制、自定义格式和钩子。文章指出了使用`logrus`时可能遇到的问题,如全局logger滥用、日志级别设置不当和过度依赖字段,并给出了避免错误的建议,强调理解日志级别、合理利用结构化日志、模块化日志管理和定期审查日志配置的重要性。通过这些实践,开发者能提高应用监控和故障排查能力。
88 1