Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Random Access File I/O

This type Opeate of I/O implementation opeate with files with using standard Java inferface.

This option was default before 2.4.

...

This option is default after 2.4. In was introduced to protect IO module and underlying files from close by interrupt problem.

Direct I/O

 

Since Ignite 2.4 there is plugin for enabling Direct I/O is implemented by Ignite plugin, since 2.4.mode. 

Direct I/O is a feature of the file system whereby file reads and writes go directly from the applications to the storage device, bypassing the operating system read and write caches (page cache). Direct I/O is useful by applications (such as databases) that manage their own caches, as Ignite is.

 

Since Ignite 2.4 there is plugin for enabling Direct I/O enforces application to do block read/write operation, that means data having size less than block can't be written or loaded from disk.

Plugin works on Linux with the version of the mode. Plugin works on Linux with the version of the kernel over 2.4.2. This plugin switches the input of the output for durable (page) memory to use the mode Direct IO. If incompatible OS or FS is used, plugin has no effect and fallbacks to regular I/O implementation.

 

Durable memory page size should be not less than physical device block and Linux system page size. Durable memory page size should be divisible by underlying OS and FS blocks sizes. Usually both sizes are 4Kbytes, so using default page size is usually sufficient to enable plugin.

There is no need to do additional configuration of plugin. It is sufficient to add There is no need to do additional configuration of plugin. It is sufficient to add ignite-direct-io.jar to classpath. Plugin jar is available under optional libs folder:
apache-ignite-fabric-x.x.x-bin\libs\optional\ignite-direct-io\ignite-direct-io-x.x.x.jar
However, disabling plugin’s function is possible through system Property.

...

Enabled direct input-output mode allows Ignite to bypass the system cache pages Linux is fully conveys the management of pages to Ignite.

WAL

 Direct I/O mode can't be enabled for Write Ahead Log files. However, when working with plugin, WAL manager applies advising Linux systems do not store the data of the file in page cache as they are not required.

Direct I/O & Performance

Direct I/O can bring possible negative effects to performance of reading pages. In Direct I/O mode all pages are read bypassing Linux cache directly from the disk.

Compared with partially filled page cache direct disk access can slow down

  • the scenarios of the initial data load as well as
  • loading data pages previously replaced to disk (rotation of pages)

This effect is taking place because using a conventional input-output without flag Direct I/O has a chance to work faster if

  • required pages remain in the Linux system cache. RAM access greatly speeds up access to them.
  • the Linux kernel makes the so-called pre-fetching when reading a file. Pre-fetching pages allows to read more data, than actually was requested by application. Currently pre-fetching is not implemented in plugin


Direct I/O still can be used for production in case of accurate configuration. So currently the Direct I/O mode is not enabled by default.

Benefit of using Direct I/O is more predictable time of fdatasync (fsync) operation. As all data is not accumulated in RAM and goes directly to disk, each fsync of page store requires less time, than fsync'ing all data from memory. Direct I/O does not guarantee fsync(), immediately after write, so checkpoint writers still calls fsync at the end of checkpoint.