[InnoDB] io_setup() failed with EAGAIN. Will make 5 attempts before giving up


I am getting the following error on my MySQL 8.x server:

2021-06-14T19:34:09.680847Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25) starting as process 219
2021-06-14T19:34:09.700518Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-06-14T19:34:09.765797Z 1 [Warning] [MY-012582] [InnoDB] io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
2021-06-14T19:34:09.766120Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 1.
2021-06-14T19:34:10.266497Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 2.
2021-06-14T19:34:10.766941Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 3.
2021-06-14T19:34:11.267382Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 4.
2021-06-14T19:34:11.767823Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 5.
2021-06-14T19:34:12.268312Z 1 [ERROR] [MY-012584] [InnoDB] io_setup() failed with EAGAIN after 5 attempts.
2021-06-14T19:34:12.268917Z 1 [ERROR] [MY-012954] [InnoDB] Cannot initialize AIO sub-system
2021-06-14T19:34:12.269130Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2021-06-14T19:34:12.269327Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-06-14T19:34:12.269701Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-06-14T19:34:12.270010Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-06-14T19:34:12.272259Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.25)  MySQL Community Server - GPL.

What does it mean? How to fix it?

You need to increase aio-max-nr value to something that will allow MySQL to run.

What is aio-max-nr ?

The Asynchronous non-blocking I/O (AIO) feature that allows a process to initiate multiple I/O operations simultaneously without having to wait for any of them to complete. The Linux kernel provides aio-max-nr.

How to see current value

Use the cat command:

cat /proc/sys/fs/aio-max-nr 
cat /proc/sys/fs/aio-nr

We can use the sysctl command also:

sysctl  fs.aio-nr
sysctl fs.aio-max-nr

Setting the sysctl parameter aio-max-nr value to 524288

Execute the sysctl:

sudo sysctl -w fs.aio-max-nr=1048576

1048576 is very high, start with something like 524288.

sudo sysctl -w fs.aio-max-nr=524288

Edit the /etc/sysctl.conf

To set the aio-max-nr value at boot time permanently

sudo vim /etc/sysctl.conf



Save and then run:

sudo sysctl -p /etc/sysctl.conf

Restart the MySQL server

sudo systemctl restart mysql

It should work now.

1 Like

Now mysql is running smoothly.

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki