Articles in this section

MySQL/MariaDB error on the server with Plesk: Could not increase number of max_open_files to more than 16384

DoNotDelete:docref Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • The following error can be seen when checking MySQL/MariaDB status via the systemctl status mariadb command:

    CONFIG_TEXT: [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:

CONFIG_TEXT: #Number of files limit
LimitNOFILE=16384

Resolution

  1. Connect to the server via SSH

  2. 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.

  3. 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:

    CONFIG_TEXT: LimitNOFILE=32335

  4. Save the changes and close the file
  5. Reload all daemons on the server:

    # systemctl daemon-reload

  6. Restart the mariadb or mysql service:

    # systemctl restart mariadb

Was this article helpful?

Comments

1 comment
Date Votes
  • Step 3 is wrong. Founded files says “It's not recommended to modify this file in-place, because it will be overwritten during package upgrades.”

    You must go to /etc/systemd/system/mariadb.service.d and create a new file like "custom_limits.conf" and put this in it:

    [Service]
    LimitNOFILE=32335

    and continue with step 4, 5 and 6.

    Step 7: Check its working with:

    # systemctl status mariadb

    0

Please sign in to leave a comment.