0

I have an issues with my MySQL server where we are getting consistent "Too Many Files Open" errors. Our current "Open Files Limit" field is set to 1024 and our Open Files never gets above 500.

I think the issue is because of the innodb_open_files variable which is stuck at 400 and I'm unable to find a way to increase that value. I seem to always be getting close too, or reaching this limit every time I have this issue.

I often have a lot of users connecting to this server.

This is my my.cnf file

open_files_limit = 1024
max_connections = 1024
innodb_open_files = 1023

Any suggestions to increase this value?

2
  • this isn't a mysql problem it is a linux problem
    – nbk
    Commented Oct 27, 2021 at 20:53
  • Additional information request, please. Any SSD or NVME devices on MySQL Host server? Post on pastebin.com and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; AND Optional very helpful information includes - htop OR top for most active apps, ulimit -a for a Linux/Unix list of limits, iostat -xm 5 3 for IOPS by device and core/cpu count, for server workload tuning analysis to provide suggestions. Commented Oct 27, 2021 at 21:24

1 Answer 1

0

In some OSs, the number of files allowed for a process is only 1024, as reflected by this inside MySQL

open_files_limit = 1024

The fix is to change the OS setting via ulimit before starting mysqld:

ulimit -n 4096

Or... Append these two lines to /etc/security/limits.conf

mysql hard nofile 65535
mysql soft nofile 65535

The "500" may be because of more than one "file" needing to be opened for each "table".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.