Oracle and Linux AsyncIO Parameter

简介:
简单的了解一下异步IO(asynchronous IO),在一个程序中如果涉及到磁盘的IO操作时,有两种情况
1. 程序等待IO操作完成,CPU再接下来处理程序的其他部分(等待IO的时间段内,CPU处于Idle Waiting状态)。
2. 程序不等待IO操作完成,允许CPU处理接下来的其他任务(或者理解为允许CPU处理接下来的不依赖于IO完成的任务)。
显然,第一种情况,CPU的资源白白的浪费了,也就是同步IO。第二种情况更有利于CPU的充分利用,这就是异步IO。

系统级 : 
Linux 参数包含如下,有系统内核参数可以用来调整异步IO的大小,aio-nr不需要调整,反映当前系统的异步IO情况,需要调整的是aio-max-nr参数。
aio-nr & aio-max-nr:

aio-nr shows the current system-wide number of asynchronous io requests.  

aio-nr is the running total of the number of events specified on the io_setup system call for all currently active aio contexts.  
If aio-nr reaches aio-max-nr then io_setup will fail with EAGAIN.  
Note that raising aio-max-nr does not result in the pre-allocation or re-sizing of any kernel data structures.

aio-max-nr allows you to change the maximum value aio-nr can grow to.
例如:
[root@db-192-168-101-35 Documentation]# sysctl -a|grep aio
fs.aio-max-nr = 1048576
fs.aio-nr = 0
可以看出当前系统的最大允许的异步IO=1MB. 
RHEL5.5默认是64KB

数据库级 :
Oracle(最左边是默认值) : 
DISK_ASYNCH_IO = true | false
是否使用操作系统的异步IO,默认为启用。如果不启用的话,可以设置DBWR_IO_SLAVES,让ORACLE自己来模拟异步IO。

DBWR_IO_SLAVES = 0 to operating system-dependent
是否开启ORACLE模拟异步IO的操作,默认=0,不开启。仅当DISK_ASYNCH_IO=flase时才需要修改这个参数。

FILESYSTEMIO_OPTIONS = { none | setall | directIO | asynch }
文件系统的IO选项,默认为NONE,这个参数貌似不设置也不会影响系统级别的异步IO,但是有些DBA还是比较喜欢把这个设置为setall。
directIO表示绕过文件系统的缓存。asynch表示启用文件系统的异步IO。

DBWR_IO_SLAVES模拟异步IO介绍 : 
DBWR_IO_SLAVES is relevant only on systems with only one database writer process (DBW0). It specifies the number of I/O server processes used by the DBW0 process. The DBW0 process and its server processes always write to disk. By default, the value is 0 and I/O server processes are not used.

If you set DBWR_IO_SLAVES to a nonzero value, the number of I/O server processes used by the ARCH and LGWR processes is set to 4. However, the number of I/O server processes used by Recovery Manager is set to 4 only if asynchronous I/O is disabled (either your platform does not support asynchronous I/O or disk_asynch_io is set to false).

Typically, I/O server processes are used to simulate asynchronous I/O on platforms that do not support asynchronous I/O or that implement it inefficiently. However, you can use I/O server processes even when asynchronous I/O is being used. In that case the I/O server processes will use asynchronous I/O.

I/O server processes are also useful in database environments with very large I/O throughput, even if asynchronous I/O is enabled.


参考 : 
http://en.wikipedia.org/wiki/Asynchronous_I/O
目录
相关文章
|
Oracle 关系型数据库 MySQL
Oracle Linux 8.10 编译安装sysbench
Oracle Linux 8.10 编译安装sysbench
649 34
|
Oracle Cloud Native 关系型数据库
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
699 11
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
|
Oracle Cloud Native 关系型数据库
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
757 0
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
|
Oracle 关系型数据库 MySQL
Oracle linux 8 二进制安装 MySQL 8.4企业版
Oracle linux 8 二进制安装 MySQL 8.4企业版
776 1
|
Oracle 关系型数据库 Linux
MyEMS开源系统安装之CentOS/RHEL/Rocky/AlmaLinux/Oracle Linux
本指南介绍如何在CentOS/RHEL/Rocky/AlmaLinux/Oracle Linux服务器上部署MyEMS开源能源管理系统。内容涵盖系统准备、数据库配置、多个MyEMS服务(如myems-api、myems-admin、myems-modbus-tcp等)的安装与配置,以及Nginx服务器设置和防火墙规则调整。通过完成所有步骤,您将能够访问MyEMS Admin UI和Web UI,默认端口分别为8001和80,初始登录凭据已提供。
1092 0
|
Oracle 关系型数据库 Linux
linux8安装oracle 11g遇到的问题记录
Oracle 11g在Linux 8上安装时会遇到link编译环节的问题。官方建议忽略安装中的链接错误,安装完成后应用DBPSU 11.2.0.4.240716补丁及一次性补丁33991024,再重新编译二进制文件,并配置监听器和数据库。但因11g已退出服务期,这些补丁需付费获取。网上信息显示22年1月的PSU补丁也可解决问题,找到该补丁后按常规方式打补丁即可。如有需求或疑问可咨询我。
1192 20
|
Oracle Cloud Native 关系型数据库
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
562 10
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
|
Oracle 网络协议 关系型数据库
linux安装oracle client客户端远程连接数据库
  linux安装oracle client客户端远程连接数据库。   1.到oracle官网下载basic,sqlplus,devel三个软件包   oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.tar   oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.tar   oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.tar   2.到root用户下创建一个oracle文件夹
839 0
|
Oracle 关系型数据库 Linux
实战篇:Linux 安装 Oracle 11GR2 数据库保姆级教程(二)
实战篇:Linux 安装 Oracle 11GR2 数据库保姆级教程(二)
实战篇:Linux 安装 Oracle 11GR2 数据库保姆级教程(二)
|
存储 Oracle 关系型数据库