dokku/dokku-mysql

Maximum number of databases is 23

Avramenkovv opened this issue · 1 comments

If you're using Dokku - especially for commercial purposes - consider donating to project development via OpenCollective or Patreon. Funds go to general development, support, and infrastructure costs.

If you'd like to sponsor specific functionality, see the project's Sponsoring document.

If you need support for a version of Dokku that is more than a year old, your issue may be closed without an answer. Please upgrade to a recent version before filing an issue.

Description of problem

Maximum number of databases is 23. 24th is not starting.

How reproducible

Create 24 databases.

Steps to Reproduce

Create more than 24 databases.
2.
Run script
#!/bin/bash
for (( i=1; i <= 30; i++ ))
do
dokku mysql:create db$i
done

=====> db23 mysql service information
Config dir: /var/lib/dokku/services/mysql/db23/config
Data dir: /var/lib/dokku/services/mysql/db23/data
Dsn: mysql://mysql:2b7b1bfc5e5e3e11@dokku-mysql-db23:3306/db23
Exposed ports: -
Id: 1c8a0e6bc23bfaa47675ee50ca051daa182c7ce33159a0e9adee8185a3a0163f
Internal ip: 172.17.0.24
Links: -
Service root: /var/lib/dokku/services/mysql/db23
Status: running
Version: mysql:5.7.28
Waiting for container to be ready
=====> MySQL container created: db24
=====> db24 mysql service information
Config dir: /var/lib/dokku/services/mysql/db24/config
Data dir: /var/lib/dokku/services/mysql/db24/data
Dsn: mysql://mysql:8543b17bc5c17343@dokku-mysql-db24:3306/db24
Exposed ports: -
Id: 26870705a4d3ceee58c360c9b7f77dc872afd07dbbf263542ba982e520183522
Internal ip: 172.17.0.25
Links: -
Service root: /var/lib/dokku/services/mysql/db24
Status: running
Version: mysql:5.7.28
Waiting for container to be ready
ERROR: unable to connect
Waiting for container to be ready
ERROR: unable to connect
Waiting for container to be ready
ERROR: unable to connect

dokku mysql:info 24th-database
Status: restarting
Version: mysql:5.7.28

dokku mysql:logs 24th-database
2020-10-01T08:56:41.982957Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-10-01T08:56:41.982966Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-10-01T08:56:41.982977Z 0 [ERROR] Failed to initialize builtin plugins.
2020-10-01T08:56:41.982984Z 0 [ERROR] Aborting

2020-10-01 08:57:42+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.28-1debian9 started.
2020-10-01 08:57:42+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-10-01 08:57:42+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.28-1debian9 started.
2020-10-01 08:57:43+00:00 [Note] [Entrypoint]: Initializing database files
2020-10-01T08:57:43.109673Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-10-01T08:57:43.117118Z 0 [Warning] InnoDB: io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
2020-10-01T08:57:43.117156Z 0 [Warning] InnoDB: io_setup() attempt 1.
2020-10-01T08:57:43.617533Z 0 [Warning] InnoDB: io_setup() attempt 2.
2020-10-01T08:57:44.117901Z 0 [Warning] InnoDB: io_setup() attempt 3.
2020-10-01T08:57:44.618264Z 0 [Warning] InnoDB: io_setup() attempt 4.
2020-10-01T08:57:45.118633Z 0 [Warning] InnoDB: io_setup() attempt 5.
2020-10-01T08:57:45.619008Z 0 [ERROR] InnoDB: io_setup() failed with EAGAIN after 5 attempts.
2020-10-01T08:57:45.619159Z 0 [ERROR] InnoDB: Cannot initialize AIO sub-system
2020-10-01T08:57:45.619182Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2020-10-01T08:57:45.619197Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-10-01T08:57:45.619207Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-10-01T08:57:45.619218Z 0 [ERROR] Failed to initialize builtin plugins.
2020-10-01T08:57:45.619226Z 0 [ERROR] Aborting

Problem has been solved with:
echo 524288 > /proc/sys/fs/aio-max-nr
echo "fs.aio-max-nr = 524288" >> etc/sysctl.conf

Solved
echo 524288 > /proc/sys/fs/aio-max-nr
echo "fs.aio-max-nr = 524288" >> etc/sysctl.conf