HOW TO CHECK IF ASYNCHRONOUS I/O IS WORKING ON LINUX
PURPOSE
-------
In this document we are going to explain how to check that asynchronous I/O
(AIO) is working. AIO can be enabled in Oracle 9i 9.2 and higher.
SCOPE & APPLICATION
-------------------
Many times there is a requirement to check if Asynchronous I/O is working
on Linux Platform, so we can try to use it for our datafiles access
inside database.
SOLUTION[@more@]--------
slabinfo maintains statistics about objects in memory. Some of the structs used
by Asynchronous I/O are threated as objects in the virtual memory, so we can
look for those structs on slabinfo. The ones related to AIO are named kio*.
$ cat /proc/slabinfo | grep kio
for example:
output with async io enabled.
$ cat /proc/slabinfo | grep kio
kioctx 270 270 128 9 9 1 : 252 126
kiocb 66080 66080 96 1652 1652 1 : 252 126
kiobuf 236 236 64 4 4 1 : 252 126
$
output with async io disabled.
$ cat /proc/slabinfo | grep kio
kioctx 0 0 128 0 0 1 : 252 126
kiocb 0 0 96 0 0 1 : 252 126
kiobuf 0 0 64 0 0 1 : 252 126
$
There are 3 caches involved.
The kioctx and kiocb are Async I/O data structures that are defined in aio.h.
If it shows a non zero value that means async io is enabled.
If you have the source code loaded, you can review it at file aio.h.
This file is located under:
/usr/src/linux-/include/linux/aio.h
These data structures are using to track the I/O requests, and are allocated as
part of the __init_aio_setup() call in aio.c.
Example strace of dbw0 process with AIO enabled (init.ora parameter
filesystemio_options = asynch) shows:
io_submit(3071864832, 1, {{0xb7302e34, 0, 1, 0, 21}}) = 1
gettimeofday({1176916625, 58882}, NULL) = 0
io_getevents(-1223102464, 1, 1024, {{0xb7302e34, 0xb7302e34, 8192, 0}}, {600, 0}) = 1
Example strace of dbw0 process with AIO disabled
(filesystemio_options = none):
pwrite64(21, "624200421300220B243162073571"..., 8192, 36077568) = 8192
times(NULL) = 1775653082
times(NULL) = 1775653082
pwrite64(21, "6242<21300220B243162542*"..., 8192, 36143104) = 8192
CAVEAT FOR ASMLib
-----------------
If Oracle ASMLib (see ) is deployed,
the kiocb structs are not used. ASMLib does not use the POSIX aio_*() functions.
You will never see any kioctx or kiocb structures from ASMLib.
It is far lower level than that.
In fact, ASMLib does AIO or SyncIO depending on how the I/O is passed to it,
It makes no decisions at all. This is entirely up to kfk and the layers above it,
kfk is entirely controlled by the disk_asynch_io parameter.
So, we can check whether ASMLib is doing AIO by PL/SQL command "show param disk_asynch_io".
(You can disable AIO by set disk_asynch_io=false)
With ASMLib, AIO is done via ioctl() calls (2.4 kernel), or read() calls (2.6 kernel) on the ASM device.
Whether ASMLib uses aio depends on whether oracle is configured to do aio,
In oracle 10g, if ASMLib is in use, the i/o is asynchronous,
because oracle 10g enables aio by default.
The strace when using ASMlib will show read calls that look like this:
read(16, "MSA210P222377377377@3133735"..., 80) = 80
The first 3 characters, byte-swapped, are ASM, indicating an ASMLib I/O
command structure.
-------
In this document we are going to explain how to check that asynchronous I/O
(AIO) is working. AIO can be enabled in Oracle 9i 9.2 and higher.
SCOPE & APPLICATION
-------------------
Many times there is a requirement to check if Asynchronous I/O is working
on Linux Platform, so we can try to use it for our datafiles access
inside database.
SOLUTION[@more@]--------
slabinfo maintains statistics about objects in memory. Some of the structs used
by Asynchronous I/O are threated as objects in the virtual memory, so we can
look for those structs on slabinfo. The ones related to AIO are named kio*.
$ cat /proc/slabinfo | grep kio
for example:
output with async io enabled.
$ cat /proc/slabinfo | grep kio
kioctx 270 270 128 9 9 1 : 252 126
kiocb 66080 66080 96 1652 1652 1 : 252 126
kiobuf 236 236 64 4 4 1 : 252 126
$
output with async io disabled.
$ cat /proc/slabinfo | grep kio
kioctx 0 0 128 0 0 1 : 252 126
kiocb 0 0 96 0 0 1 : 252 126
kiobuf 0 0 64 0 0 1 : 252 126
$
There are 3 caches involved.
The kioctx and kiocb are Async I/O data structures that are defined in aio.h.
If it shows a non zero value that means async io is enabled.
If you have the source code loaded, you can review it at file aio.h.
This file is located under:
/usr/src/linux-
These data structures are using to track the I/O requests, and are allocated as
part of the __init_aio_setup() call in aio.c.
Example strace of dbw0 process with AIO enabled (init.ora parameter
filesystemio_options = asynch) shows:
io_submit(3071864832, 1, {{0xb7302e34, 0, 1, 0, 21}}) = 1
gettimeofday({1176916625, 58882}, NULL) = 0
io_getevents(-1223102464, 1, 1024, {{0xb7302e34, 0xb7302e34, 8192, 0}}, {600, 0}) = 1
Example strace of dbw0 process with AIO disabled
(filesystemio_options = none):
pwrite64(21, "624200421300220B243162073571"..., 8192, 36077568) = 8192
times(NULL) = 1775653082
times(NULL) = 1775653082
pwrite64(21, "6242<21300220B243162542*"..., 8192, 36143104) = 8192
CAVEAT FOR ASMLib
-----------------
If Oracle ASMLib (see ) is deployed,
the kiocb structs are not used. ASMLib does not use the POSIX aio_*() functions.
You will never see any kioctx or kiocb structures from ASMLib.
It is far lower level than that.
In fact, ASMLib does AIO or SyncIO depending on how the I/O is passed to it,
It makes no decisions at all. This is entirely up to kfk and the layers above it,
kfk is entirely controlled by the disk_asynch_io parameter.
So, we can check whether ASMLib is doing AIO by PL/SQL command "show param disk_asynch_io".
(You can disable AIO by set disk_asynch_io=false)
With ASMLib, AIO is done via ioctl() calls (2.4 kernel), or read() calls (2.6 kernel) on the ASM device.
Whether ASMLib uses aio depends on whether oracle is configured to do aio,
In oracle 10g, if ASMLib is in use, the i/o is asynchronous,
because oracle 10g enables aio by default.
The strace when using ASMlib will show read calls that look like this:
read(16, "MSA210P222377377377@3133735"..., 80) = 80
The first 3 characters, byte-swapped, are ASM, indicating an ASMLib I/O
command structure.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19423/viewspace-968721/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How To Check if Asynchronous I/O is Working On Linux (Doc ID 237299.1)Linux
- HOW TO CHECK IF ASYNCHRONOUS I/O IS WORKING ON LINUX轉自http://sundog315.itpub.net/LinuxHTTP
- asynchronous i/o (aio) on HP-UXAIUX
- [Oracle Script] check File I/OOracle
- HP-UX: Asynchronous i/o (Doc ID 139272.1)UX
- SOLARIS: Asynchronous I/O (AIO) on Solaris (SPARC) servers_48769.1AIServer
- Asynchronous I/O Support On Windows (Doc ID 1228845.1)Windows
- How to Tell if the I/O of the Database is Slow - 1Database
- Understanding How to Set the SQL Server I/O Affinity OptionSQLServer
- Probable reasons when Credit check is not working
- How to Perform a Health Check on the DatabaseORMDatabase
- How to check payroll result is posted?
- How to check Database corrupt BlockDatabaseBloC
- ejb object too much ,how server working??ObjectServer
- Linux I/O排程器Linux
- 深入 Linux I/O 重定向Linux
- 【SQLSERVER】How to check current pool sizeSQLServer
- How to check oracleasm configOracleASM
- Linux下的5種I/O模型與3組I/O複用Linux模型
- Veritas Quick I/O and Cached Quick I/OUI
- Linux下磁碟I/O測試Linux
- Linux裡五種I/O模型Linux模型
- Linux libaio 非同步I/OLinuxAI非同步
- linux I/O 瓶頸監控Linux
- 計算機I/O與I/O模型計算機模型
- I/O埠和I/O記憶體記憶體
- How do I disable the iptables firewall in Fedora Core Linux?Linux
- Linux 下的I/O效能分析 iotopLinux
- linux監測I/O效能-iostatLinuxiOS
- Java I/OJava
- Linux之《荒島餘生》(四)I/O篇Linux
- 如何監測 Linux 的磁碟 I/O 效能Linux
- 如何更改Linux的I/O排程器Linux
- 【I/O scheduler】Linux的磁碟排程策略Linux
- Linux shell I/O重定向詳解(zt)Linux
- 在Linux下測試磁碟的I/OLinux
- How to check whether the current database in using Oracle optionsDatabaseOracle
- How to Check whether SELinux is Enabled or Disabled [ID 432988.1]Linux