Direct I/O may be enabled via two methods:
- Use of the O_DIRECT flag to the open(2) system call.
- Use of the dio mount option.
Direct I/O should be used where either the application does its own caching (like many databases, eg. Oracle, DB2, Sybase, PostgreSQL, TSM, MySQL using InnoDB) or where the same data will not be read/written again for some time (eg. TSM disk storage pools).
Bear in mind, that direct I/O performance still falls slightly short of the performance achieved by using raw logical volumes. With many applications, using raw logical volumes can be just as easy to manage.
- When using direct I/O, all reads and writes must be aligned to, and a multiple of, the filesystem block size, often being between 512 bytes and 4 kibibytes. Any read/write request which does not meet this criteria will be forced to go through the file cache and VMM.
- Any file mapped using mmap(2), shm_open(2), etc will default to using the file cache and VMM for all I/O from all processes. Once unmapped, I/O will return to using direct I/O.
- AIX Wiki Performance Monitoring, link to "Understanding DIO & CIO".
- Use Direct I/O to improve performance of your AIX applications