Symptoms
-
The following error can be seen when checking MySQL/MariaDB status:
# systemctl status mariadb
MySQL error: Could not increase number of max_open_files to more than 16384 (request: 32335). -
MySQL/MariaDB performance is slow.
Cause
Hard limit of the process exceeded the number set for open files limit (16384) in /etc/systemd/system/mysqld.service
:
#Number of files limit
LimitNOFILE=16384
Resolution
-
Connect to the server via SSH.
-
Edit file
/etc/systemd/system/mysqld.service
.Note: Depending on the OS, this can be found at
/lib/systemd/system/mariadb.service
instead. -
Change the line
LimitNOFILE
as follows:LimitNOFILE=32335
-
Reload daemons:
# systemctl daemon-reload
-
Restart
mariadb
service:# systemctl restart mariadb