0

I have LAMP with CentOS 8 and MariaDB installed on my server. in PHPMyAdmin I need to increase open files limit parameter, which is disabled and cannot be edited from there. its current value is set to 16,​384. I checked the hard and soft limits of the server:

ulimit -Hn
262144


ulimit -Sn
1024

cat /proc/sys/fs/file-max
199584

moreover I checked /etc/security/limits.conf and there was no limit mentioned there for open files. now my question is where is this 16,384 limit coming from (where is it set)? and how can I increase it?

  • What happens when you just set `open-files-limit` in the `mysqld` section of `my.cnf`? If that does not work, I would assume you need to tweak the systemd config for the service. – Håkan Lindqvist Dec 29 '20 at 13:30
  • @HåkanLindqvist many thanks. I added `open-files-limit=16500` below `[mysqld]` section of `server.cnf` file (which is included in my.cnf) and restarted mariadb, but the value did not change in phpmyadmin – user589154 Dec 29 '20 at 14:10

1 Answers1

1

System wide limits for max number of open file descriptors are set in /etc/security/limits.conf with the "nofile" item.

The entries for the mysql user would look like this:

mysql            hard    nofile          16384
mysql            soft    nofile          16384

since CentOS 8 uses systemd, systemd itself might set the limit via the "LimitNOFILE" option in the systemd service file.

check the systemd service file (most likely "/lib/systemd/system/mariadb.service") for "LimitNOFILE=16384". If you want to change the limit, don't edit this file (it might get overwritten when updating the mariadb package), copy the file to "/etc/systemd/system/" and edit it there.

Marc
  • 121
  • 4
  • This probably also ought to cover the my.cnf setting – Håkan Lindqvist Dec 29 '20 at 14:06
  • @Marc. amazing! worked like a charm! the only point is that there were no records for mysql in limits.conf file and so I only edited LimitNOFILE in mysql.service file as you explained. is that enough? – user589154 Dec 29 '20 at 14:16
  • yes. if systemd starts the service, you only need the "LimitNOFILE" option. – Marc Dec 29 '20 at 14:21