Thursday, June 25, 2015

MySQL open files limit

The MySQL open files limit is currently 1024 by default. I tried to just increase the open_files_limit in /etc/my.cnf, but you/I need to update the system itself!  If you can get your system to accept more files opened at once, you can get this up to 65536.

Here is how to get started....

ulimit -n
vi /etc/security/limits.conf
Add the following to bottom of file to set for everything *:
* soft nofile 1024000
* hard nofile 1024000
* soft nproc 10240
* hard nproc 10240
Repeat for /etc/security/limits.d/90-nproc.conf
vi /etc/security/limits.d/90-nproc.conf
To temporarily set the open files limit for the user you are currently logged in under (e.g. 'root')
ulimit -Hn 1024000

This was not enough for me though!!! CentOS 7.

these two both answer the question!

 needed to edit /usr/lib/systemd/system/mysqld.service and add
Then run systemctl daemon-reload and systemctl restart mysql.service.

Thanks again to the community at large.  :)