I have mysql ver. 5.1.49-3, I am working on linux debian. I am trying to set open-files-limit to 65535. so I edited te my.cnf in /etc/mysql/
[mysqld]
open_files_limit = 65535
[mysqld_safe]
open_files_limit = 65535
then in /etc/security/limit.conf
* soft nofile 100000
* hard nofile 200000
After restarting mysql service, when I run this command in linux
ps -ef|grep mysql
I got 65535. when I log into mysql as root and fetch the value of open-files-limit
show global variables like "%open_files_limit%";
I got 1024. Please help.
To change the number of file descriptors available to mysqld, you can use the --open-files-limit option to mysqld_safe or set the open_files_limit system variable. See Section 5.1. 8, “Server System Variables”. The easiest way to set these values is to add an option to your option file.
The open_files_limit is a soft limit set by MySQL. The operating system determines the hard limit on file descriptors. That is why, even if the open_files_limit variable is set to a high value, mysqld service shows the warning, [Warning] Could not increase number of max_open_files to more than xxxx.
If mysql is started with systemd, this setting is important:
In the file /lib/systemd/system/mysql.service
you have to add this 2 lines in the [Service]
section at the end:
LimitNOFILE = infinity
LimitMEMLOCK = infinity
After this restart systemctl and mysql:
systemctl daemon-reload
/etc/init.d/mysql restart
To check if the configuration is effective, you can get the parameter from the running mysql process like this:
cat /proc/$(pgrep mysqld$)/limits | grep files
All I need is to add this line to /etc/pam.d/common-session:
session required pam_limits.so
then restart apache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With