_use_adaptive_log_file_sync

2018年2月23日 1052点热度 0人点赞 0条评论

该参数在commit次数较多的系统中,post/wait and polling特性对性能影响明显,主要是在写日志上的等待上影响了事务的提交速度,建议在11g中关闭(设置为false)。

col sess_value for a11
col inst_value for a11
SELECT a.ksppinm NAME, a.ksppdesc description, b.ksppstvl sess_value, c.ksppstvl inst_value
  FROM x$ksppi a, x$ksppcv b, x$ksppsv c
 WHERE a.indx = b.indx AND a.indx = c.indx AND substr(a.ksppinm, 1, 1) = '_' AND
       a.ksppinm LIKE '_use_adaptive_log_file_sync'
 ORDER BY a.ksppinm;
--------------------------- ----------------------------------------------- ---- ----
_use_adaptive_log_file_sync Adaptively switch between post/wait and polling TRUE TRUE

在11gr2以前写日志缓冲区到文件方式是通过Post/wait方式,在11gr2开始增加了Polling的方式,在11.2.0.3以前默认还是采用Post/wait方式,11.2.0.3开始默认是两种方式自动切换,当值为true时开启自动切换模式。
[post/wait]用户会话被动等待LGWR通知redo写入到logfile完毕,这种方式响应速度比较快。若cpu空闲时采用这种方式可以体验到更好的响应时间。
[polling] 用户会话主动监测LGWR是否完成写入。这种方式比post/wait方式响应速度慢,LGWR不直接把完成的消息通知到很多用户会话,可以节约CPU资源。若cpu繁忙时采用这种方式可以降低cpu资源的消耗。

在lgwr日志中可以看到切换的信息
Log file sync switching to polling
Log file sync switching to post/wait

查询当前log file sync的方式
select name,value from v$sysstat where name like 'redo sync%';
NAME                                                              VALUE
-------------------------------------------------- --------------------
redo synch time                                               2,128,216
redo synch time (usec)                                   23,870,232,157
redo synch time overhead (usec)                         835,534,661,905
redo synch time overhead count (<2 msec)                     62,040,241
redo synch time overhead count (<8 msec)                        275,313
redo synch time overhead count (<32 msec)                        94,173
redo synch time overhead count (<128 msec)                       34,487
redo synch time overhead count (>=128 msec)                      16,045
redo synch writes                                            65,546,778
redo synch long waits                                           331,738
redo synch poll writes                                       57,518,660
redo synch polls                                             82,302,402

 

liking

这个人很懒,什么都没留下

文章评论