I have an issue with the following error:
Too many open files (24)
And after lots of hours researching, we noticed that Open_files status do show a count of files opened, but the error occured when this number was below the open_files_limit setting? How is this possible?
We are using table_open_cache setting as well and after reading how MySQL documentation about table_open_cache and how MySQL opens and closes tables, we start to think it's because that the status count open_files does not calculate the tables opened that goes into table_open_cache, but not sure.
Any clear answer on how this can be possible?
The current version of Amazon Linux AMI utilises systemd. If that's what you are using whatever you set in
/etc/security/limits.conf
will be ignored by systemd.Find the .service file for your version of MySQL and update it. For example:
Under the
Service
section add the following:Change 4096 to the limit you need.
Afer you update that file reload the systemd configuration:
Then restart the mysql server.
Run following commands to see open-files limit:
And from system side:
Add following line into your my.cnf:
Eximine /etc/security/limits.conf for strings with mysql, and add it if needed:
Then restart mysql-server Сhange the value to the one you need