Direct I/O (UNIX)

On UNIX, you can use direct I/O to improve the performance of cooked files. Direct I/O can be beneficial because it avoids file system buffering. Because direct I/O uses unbuffered I/O, it is more efficient for reads and writes that go to disk (as opposed to those reads and writes that merely access the file system buffers).

Direct I/O generally requires data to be aligned on disk sector boundaries.

Direct I/O also allows the use of kernel asynchronous I/O (KAIO), which can further improve performance. By using direct I/O and KAIO where available, the performance of cooked files used for dbspace chunks can approach the performance of raw devices.

If your file system supports direct I/O for the page size used for the dbspace chunk, the database server operates as follows:
  • Does not use direct I/O by default.
  • Uses direct I/O if the DIRECT_IO configuration parameter is set to 1.
  • Uses KAIO (if the file system supports it) with direct I/O by default.
  • Does not use KAIO with direct I/O if the environment variable KAIOOFF is set.

If Informix® uses direct I/O for a chunk, and another program tries to open the chunk file without using direct I/O, the open will normally succeed, but there can be a performance penalty. The penalty can occur because the file system attempts to ensure that each open sees the same file data, either by switching to buffered I/O and not using direct I/O for the duration of the conflicting open, or by flushing the file system cache before each direct I/O operation and invalidating the file system cache after each direct write.

Informix does not use direct I/O for temporary dbspaces.


Copyright© 2019 HCL Technologies Limited