MySQL IO

innodb_io_capacity

Default: 200


SELECT @@innodb_io_capacity;

To resize this variable online (without the need to restart MySQL Server)...

SET GLOBAL innodb_io_capacity=2000;

innodb_io_capacity_max

Default: 2000


SELECT @@innodb_io_capacity_max;

To resize this variable online (without the need to restart MySQL Server)...

SET GLOBAL innodb_io_capacity_max=4000;

innodb_flush_method

Default (UNIX): fsync


SELECT @@innodb_flush_method;

See the discussion linked in the Bibliography... but, in most cases it would appear that O_DIRECT is the best option.

my.cnf

innodb-flush-method = O_DIRECT

innodb_fsync_threshold

  • Introduced in MySQL 8.0.13

Default: 0


SELECT @@innodb_fsync_threshold;

innodb_use_fdatasync

  • Introduced in MySQL 8.0.26
  • Relevant when innodb_flush_method is fsync, O_DSYNC or O_DIRECT

Default: OFF

SELECT @@innodb_use_fdatasync;

innodb_use_native_aio

Default: ON

SELECT @@innodb_use_native_aio;

innodb_write_io_threads

Default: 4

SELECT @@innodb_write_io_threads;

innodb_read_io_threads

Default: 4

SELECT @@innodb_read_io_threads;

my.cnf

innodb-io-capacity                 = 2000

innodb-io-capacity-max             = 4000

Bibliography

https://serverfault.com/questions/961491/mysql-on-vm-high-io-wait-but-low-tpshttps://www.percona.com/blog/2014/06/25/why-util-number-from-iostat-is-meaningless-for-mysql-capacity-planning/
innodb_io_capacity / innodb_io_capacity_maxhttps://dba.stackexchange.com/questions/258931/setup-innodb-io-capacityhttps://dev.mysql.com/doc/refman/8.0/en/optimizing-innodb-diskio.htmlhttps://dev.mysql.com/doc/refman/8.0/en/innodb-configuring-io-capacity.htmlhttps://dev.mysql.com/doc/refman/5.7/en/innodb-configuring-io-capacity.htmlhttps://www.percona.com/blog/2019/12/18/give-love-to-your-ssds-reduce-innodb_io_capacity_max/https://www.chriscalender.com/iops-innodb_io_capacity-and-the-innodb-plugin/http://dimitrik.free.fr/blog/archives/07-01-2010_07-31-2010.html
innodb_flush_methodhttps://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_flush_methodhttps://dba.stackexchange.com/questions/298458/under-what-conditions-is-it-safe-to-use-innodb-flush-method-o-direct-no-fsynchttps://dba.stackexchange.com/questions/23943/innodb-flush-method-o-direct-vs-o-dsync-performance-impact-on-ext3-with-lvm-disk
innodb_use_fdatasynchttps://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_use_fdatasync
innodb_fsync_thresholdhttps://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_fsync_threshold
innodb_use_native_aiohttps://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_use_native_aiohttps://dev.mysql.com/doc/refman/8.0/en/innodb-linux-native-aio.html
innodb_write_io_threads / innodb_read_io_threadshttps://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_write_io_threadshttps://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_read_io_threadshttps://dev.mysql.com/doc/refman/8.0/en/innodb-performance-multiple_io_threads.html
innodb_purge_threadshttps://dev.mysql.com/doc/refman/8.0/en/innodb-purge-configuration.html