Symptoms
-
The following error can be seen when checking MySQL/MariaDB status via the
systemctl status mariadb
command:[Warning] Could not increase number of max_open_files to more than 16384 (request: 32335).
-
MySQL/MariaDB performance is very slow.
Cause
Hard limit of the process exceeded the number set for open files limit (16384) in database server configuration files:
#Number of files limit
LimitNOFILE=16384
Resolution
-
Connect to the server via SSH
- Find in which exact file the limit is set by executing the following commands:
# egrep -r LimitNOFILE /etc/systemd/system/m*
# egrep -r LimitNOFILE /lib/systemd/system/m*
Note: You are looking for a line that does not have a
#
in its beginning. That line contains the configuration that is active. -
Once you find in which file the line
LimitNOFILE
is active, edit that file with your favorite command-line text editor and adjust the value:LimitNOFILE=32335
- Save the changes and close the file
-
Reload all daemons on the server:
# systemctl daemon-reload
-
Restart the
mariadb
ormysql
service:# systemctl restart mariadb