John:
Using DIRECT_IO will indeed use KAIO! Here's the full story:
When Informix accesses RAW chunks (so character devices) it uses the OS's KAIO facility by starting a KAIO thread in each CPU VP to handle all IO to/from those RAW chunks. By default, when Informix accesses chunks built using COOKED devices or filesystem COOKED files, it does not use KAIO threads but rather assigns IO requests for these chunks to AIO VPs. Such IO goes through the OS's buffer caching system. Since using the OS's lazy cache write-back system risks data loss, those COOKED chunks are opened with the O_SYNC flag enabled which forces writes to be flushed immediately from the OS cache to disk and each such write system calls will wait for the flush to complete. The extra overhead of the copy from Informix shared memory to the OS cache and then from the cache to disk results in performance that is between 15% and 40% slower than RAW device IO (typically about 25% on most systems more if there is heavy IO activity not related to Informix and if there are not enough AIO VPs).
To mitigate this problem, and in recognition of efforts to eliminate RAW device support from Linux distributions over the years, Informix implemented DIRECT_IO for chunks built over filesystem files (but not for COOKED aka block device chunks). What this does is to open the file with the O_DIRECT flag enabled which causes IOs to bypass the OS cache entirely and write directly to storage. There is still some overhead because filesystem calls are used instead of lower level system calls, but there is not delay caused by copying the data to cache and waiting for a flush to complete. There is just a direct write from Informix cache to storage. In addition, OS KAIO functions support O_DIRECT so all reads and writes can be asynchronous without the intervention of the AIO VPs and so KAIO and KAIO threads in the CPU VPs are used for all IO activity on these chunks. The only exception is temp dbspaces which do not use DIRECT_IO by default (though you can enable that as well if it improves performance by setting DIRECT_IO to 5 (adding 0x04 to the 0x01 flag to enable direct io). This last is not documented in the online manuals, but is noted in the v14.10 onconfig.std file.
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com------------------------------
Original Message:
Sent: Mon January 04, 2021 05:03 AM
From: John Smith
Subject: DIRECT_IO/KAIO
Hi
Please give me an abstract of using these two parameters, on Linux and AIX
What i know is that DIRECT_IO is recommended for coocked files (do not use KAIO) , but what about raw devices ?
Thanks in advance for your knowledges
------------------------------
John Smith
------------------------------