When using POSIX asynchronous I/O, are there any differences between using O_DIRECT
and AIO_RAW
? Or should I/can I use both? We are working on a NoSQL database server and are looking at ways of making asynchronuous I/O more efficient on POSIX systems.
O_DIRECT Try to minimize cache effects of the I/O to and from this file. In general this will degrade performance, but it is useful in special situations, such as when applications do their own caching. File I/O is done directly to/from user space buffers.
You may set the AIO_RAW flag bit in the aio_flags structure member when the asynchronous I/O is being done to a raw device partition. When the AIO_RAW flag bit is set, asynchronous I/O might possibly be more efficient.