Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When I set open_files_limit = 16k in both: /etc/security/limits.conf and /etc/mysql/my.cnf

ulimit -n

but in mysql:

show variables like 'open_files_limit';
open_files_limit: 4096 

So how does mysql calculate open_files_limit. Is there somewhere else I should be looking?

share|improve this question
would you have to restart mysql once to take effect? –  JoseK Sep 27 '10 at 8:25
I did and tried restarting the server. –  Mario Michelli Sep 27 '10 at 10:37

3 Answers 3

Did you specify it as open_files_limit or open-files-limit in my.cnf? In config file it should be open-files-limit.

share|improve this answer

way one, u can try running lsof on mysql's pid pipe to "wc -l" way two, ll /proc//fs/

these will give you the list of open file (including sockets etc, everything is a file in unix/linux)

open files limit can be check on the mysql-client using "show global varaibles like '%files%'" and then use "set global variable open_files_limit="

be careful about it, since the number from "ulimit -n" is total for the shell for all processes, and you dont want to put it too high.

if you see this number slowly increasing you ppbly want to check your code, there are dangling references...

hope that helps.


share|improve this answer

check limits for user mysql:

limits -e -U mysql

ulimit -a - show limits for your user

If limits correct && you use Percona MYSQL then need activate limits in start script.

For example in FreeBSD: /usr/local/etc/rc.d/mysql-server find string: ${mysql_limits="NO"} and replace NO -> YES

PS. 2Janne Pikkarainen in my config my.cnf: open_files_limit = 8192

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.