lgwr的两种模式(post/wait和polling)
11.2之前,oracle的lgwr写入模式为post/wait
11.2之后新增了polling模式,可以与post/wait模式自动切换
通过隐藏参数 _use_adaptive_log_file_sync 参数来控制
查看该隐藏参数的方法:
SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
FROM SYS.x$ksppi x, SYS.x$ksppcv y
WHERE x.indx = y.indx
AND x.ksppinm LIKE '%_use_adaptive_log_file_sync%';
当参数设置为false时,lgwr还是采用post/wait方式将日志从buffer写入磁盘
当参数设置为true是,lgwr写入方式会自动在post/wait和polling模式之间进行切换,可能会造成比较严重的log file sync (当使用polling模式时)
建议关闭此参数:
alter system set "_use_adaptive_log_file_sync"=FALSE;
参数立即生效,无需重启实例。
模式切换时,lgwr的trace中会记录类似如下的信息:
两种模式的理解:(两种模式主体都是前台进程,post/wait是等待lgwr通知,polling是主动轮序lgwr)
Post/wait:用户会话被动等待LGWR通知redo写入到log file完毕,这种方式响应速度比较快。若cpu空闲时采用这种方式可以体验到更好的响应时间。
Polling:用户会话主动轮询LGWR,观测是否完成写入(轮询的间隔是10ms)。这种方式比Post/wait方式响应速度慢,但LGWR不直接把完成的消息通知到很多用户会话,可以节约CPU资源。若cpu繁忙时采用这种方式可以降低cpu资源的消耗。
官方对两种模式的解释:
Adaptive Log File sync was introduced in 11.2. the feature is exactly enabled since release 11.2.0.3 , It’s enabled through an underscore parameter called _use_adaptive_log_file_sync and the description of this parameter is: adaptively switch between post/wait and polling.
Oracle can switches between the 2 methods:
Post/wait, traditional method for posting completion of writes to redo log
LGWR explicitly posts all processes waiting for the commit to complete.
The advantage of the post/wait method is that sessions should find out almost immediately when the redo has been flushed to disk.
Polling, a new method where the foreground process checks if the LGWR has completed the write.
Foreground processes sleep and poll to see if the commit is complete. The advantage of this new method is to free LGWR from having to inform many processes waiting on commit to complete thereby freeing high CPU usage by the LGWR.If post/wait is selected and the foreground processes fail to receive a post from LGWR, an incident is recorded.diagnostic traces are performed, and polling is used instead of post/wait.
Oracle uses semaphores extensively, If you look for references to “commit” in the Oracle docs, you’ll find the word “post” everywhere when they talk about communication between the foreground processes and LGWR. Now, remember that a COMMIT has two options: first, IMMEDIATE or BATCH and second, WAIT or NOWAIT. It looks like this to me:
Immediate: FG process will post to LGWR, triggering I/O (default)
Batch: FG process will not post LGWR
Wait: LGWR will post FG process when I/O is complete (default)
NoWait: LGWR will not post FG process when I/O is complete
参考:https://blog.csdn.net/rgb_rgb/article/details/72804143
lgwr的两种模式(post/wait和polling)的更多相关文章
- Windows2003 IIS6.0支持32位和64位两种模式的设置方法
IIS 6.0 可支持 32 位和 64 位两种模式.但是,IIS 6.0 不支持在 64 位版本的 Windows 上同时运行这两种模式.ASP.NET 1.1 只在 32 位模式下运行.而 ASP ...
- 【转】Reactor与Proactor两种模式区别
转自:http://www.cnblogs.com/cbscan/articles/2107494.html 两种IO多路复用方案:Reactor and Proactor 一般情况下,I/O 复用机 ...
- ACE_linux:Reactor与Proactor两种模式的区别
一.概念: Reactor与Proactor两种模式的区别.这里我们只关注read操作,因为write操作也是差不多的.下面是Reactor的做法: 某个事件处理器宣称它对某个socket上的读事件很 ...
- JSP中两种模式的总结
运用JSP/Servlet实现的Web动态交互,主要采用: 模式一:JSP+JavaBean 链接:http://wxmimperio.coding.io/?p=155 模式二;JSP+Servlet ...
- Doctype 严格模式与混杂模式-如何触发这两种模式,区分它们有何意义?
Doctype:(Document Type)文档类型,它位于文档中最前面的位置,处于标签之前.如果你想制作符合标准的页面,一个必不可少的关键组成部分就是DOCTYPE的声明.确定了正确的Doctyp ...
- Android Studio的两种模式及签名配置
我们使用Android Studio 运行我们的app,无非两种模式:debug和release模式. debug模式 debug模式使用一个默认的debug.keystore进行签名. 这个默认签名 ...
- vue-router的两种模式的区别
众所周知,vue-router有两种模式,hash模式和history模式,这里来谈谈两者的区别. ### hash模式 hash模式背后的原理是`onhashchange`事件,可以在`window ...
- Doctype的作用?严格模式与混合模式,如何触发者这两种模式,区分它们有何意义?
Doctype作用?严格模式与混合模式,如何触发者这两种模式,区分它们有何意义? 1.1 Doctype作用 <!DOCTYPE>声明叫做文件类型定义(DTD),声明的作用为了告诉浏览器该 ...
- 【Spark篇】---SparkStreaming+Kafka的两种模式receiver模式和Direct模式
一.前述 SparkStreamin是流式问题的解决的代表,一般结合kafka使用,所以本文着重讲解sparkStreaming+kafka两种模式. 二.具体 1.Receiver模式 原理图 ...
随机推荐
- uva-10400-搜索
题意:题意很简单,就是输入数字,对数字进行加减乘除,然后能不能得到最后的数字. wa了很多次,memcpy(dst,src,sizeof(dst))才对,最后一个参数写错,最后一个参数是要拷贝的字节数 ...
- python print格式化输出。
python print格式化输出. 1. 打印字符串 print ("His name is %s"%("Aviad")) 效果: 2.打印整数 print ...
- 异步请求Ajax(取得json数据)
异步请求Ajax 没有学习Ajax之前请求数据的时候都是整个页面全部刷新了一次,也就是每次请求都会重新请求所有的资源.但是在很多时候不需要页面全部刷新,仅仅是需要页面的局部数据刷新即可,此时需要发送异 ...
- 第二篇*2、Python字符串格式化
1.字符串格式化 Python的字符串格式化有两种方式: 百分号方式.format方式 1)百分号方式 %[(name)][flags][width].[precision]typecode (nam ...
- ArcGIS自定义工具箱-修复损坏的工作空间
ArcGIS自定义工具箱-修复损坏的工作空间 联系方式:谢老师,135-4855-4328,xiexiaokui#qq.com 目的:替换数据源的工作空间 用途:针对损坏的数据源,批量进行修复 案例数 ...
- 修改tomcat的编码方式,可以解决某些get请求乱码问题
在tomcat/conf/server.xml配置文件添加如下,修改tomcat的编码方式 <Connector URIEncoding="utf-8" connection ...
- ubuntu系统中安装eclipse
具体可以看这篇博文 .https://www.cnblogs.com/sanduo1314/articles/5137090.html 然后再/usr/share/applications中找到ecl ...
- [转]IIS应用程序池经典模式转集成模式解决方案
经典模式和集成模式的区别: IIS7.0中的Web应用程序有两种配置形式:经典形式和集成形式. 经典形式是为了与之前的版本兼容,运用ISAPI扩展来调用ASP.NET运转库,原先运转于IIS6.0下的 ...
- 【你的职业规划】web前端的职业发展方向及学习攻略【转载】
web前端的职业发展方向有哪些?本文献给正在迷茫中,准备入坑web前端的初学者以及知海匠库web前端培训班的准前端工程师们: 一.职业方向定位 首先,只有确定好自己的职业方向,才能做好职业规划.在 ...
- Dart 基础重点截取 Dart 2 20180417
官网教程 https://www.dartlang.org/guides/language/language-tour dart是一个单线程的语言,没有多线程 Final and const If y ...