Asynchronous IO for file System using FILESYSTEMIO_OPTIONS

We noticed that on one of our servers oracle trc files accumulated too much. it started piling up after we increased /dev/shm and sga. In trace file below message is repeated continously.

Log read is SYNCHRONOUS though disk_asynch_io is enabled!

It meant that asynchronous IO was not working for the file systems which needed to be set by setting initialization parameter FILESYSTEMIO_OPTIONS=SETALL. By default value of this parameter is NONE. (Instance restart is required as this is not a dynamic init parameter)

Verifying Asynchronous I/O Usage

To verify whether $ORACLE_HOME/bin/oracle was linked with asynchronous I/O, you can use the Linux commands ldd and nm.In the following example, $ORACLE_HOME/bin/oracle was relinked with asynchronous I/O:

$ ldd $ORACLE_HOME/bin/oracle | grep libaio
	libaio.so.1 => /usr/lib/libaio.so.1 (0x0093d000)
$ nm $ORACLE_HOME/bin/oracle | grep io_getevent
	w io_getevents@@LIBAIO_0.1
$

In the following example, $ORACLE_HOME/bin/oracle has NOT been relinked with asynchronous I/O:

$ ldd $ORACLE_HOME/bin/oracle | grep libaio
$ nm $ORACLE_HOME/bin/oracle | grep io_getevent
	w io_getevents
$

Direct and Asynchronous I/O

I/O operations in UNIX and Linux systems typically go through the file system cache. Although this doesn’t represent a problem in itself, this extra processing does require resources. Bypassing the file system cache reduces CPU requirements, and frees up the file system cache for other non-database file operations. Operations against raw devices automatically bypass the file system cache.

When a synchronous I/O request is submitted to the operating system, the writing process blocks until the write is complete before continuing processing. With asynchronous I/O, processing continues while the I/O request is submitted and processed. This allows asynchronous I/O to bypass some of the performance bottlenecks associated with I/O operations.

Oracle can take advantage of direct I/O and asynchronous I/O on supported platforms using the FILESYSTEMIO_OPTIONS parameter, whose possible values are listed below.

  • ASYNCH – Enabled asynchronous I/O where possible.
  • DIRECTIO- Enabled direct I/O where possible.
  • SETALL- Enabled both direct I/O and asynchronous I/O where possible.
  • NONE – Disabled both direct I/O and asynchronous I/O.

The following example shows how the parameter is set.

SQL> SHOW PARAMETER FILESYSTEMIO_OPTIONS

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      none
SQL> ALTER SYSTEM SET FILESYSTEMIO_OPTIONS=SETALL SCOPE=SPFILE;

System altered.

SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP
ORACLE instance started.

Total System Global Area  926941184 bytes
Fixed Size                  1222672 bytes
Variable Size             239077360 bytes
Database Buffers          683671552 bytes
Redo Buffers                2969600 bytes
Database mounted.
Database opened.
SQL> SHOW PARAMETER FILESYSTEMIO_OPTIONS

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      SETALL
SQL>