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

http://duntuk.com/how-raise-ulimit-open-files-and-mysql-openfileslimit

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.


http://dba.stackexchange.com/questions/86987/mysql-open-files-limit-cannot-change-this-variable
http://unix.stackexchange.com/questions/152186/mysql-max-open-files-more-than-1024#answer-157910

these two both answer the question!

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

Thanks again to the community at large.  :)

Popular Posts