GDB MySQL参数Open-files-limit苏普2010-101
起源> Can't open file: '.\test\mytable.frm' (errno: 24)shell> perror 24OS error code 24: Too many open files尝试修改open_files_limitChanges the number of file descriptors available to mysqld. You should try increasing the value of this option if mysqld gives you the error Too many open files. mysqld uses the option value to reserve descriptors with setrlimit(). If the requested number of file descriptors cannot be allocated, mysqld writes a warning to the error log.
open_files_limitin my.cnf配置open_files_limit=10000global variables like "%open_files_limit%";+------------------+-------+| open_files_limit | 1024|+------------------+-------+配置open_files_limit=30000global variables like "%open_files_limit%";+------------------+-------+| open_files_limit | 1024|+------------------+-------+参数设置始终无效
Why?开启了一个痛苦代码追踪过程
gdb:watchgdb mysqld
(gdb) watch open_files_limit
(gdb) rOld value = 0New value = 20000Old value = 20000New value = 1024init_common_variables (...) at mysqld.cc:3355
Sql/mysqld.cc:3355max_open_files= max(max(wanted_files, max_connections*5),open_files_limit);3322  files= my_set_max_open_files(max_open_files);gdb mysqld
(gdb) b mysqld.cc:3322
(gdb) r
(gdb) nmysys/my_file.cuint my_set_max_open_files(uint files){...    files= set_max_open_files(min(files, OS_FILE_LIMIT));
mysys/my_file.cstatic uintset_max_open_files(uintmax_file_limit){...if (rlimit.rlim_cur >= max_file_limit) DBUG_RETURN(rlimit.rlim_cur);rlimit.rlim_cur= rlimit.rlim_max= max_file_limit;if (setrlimit(RLIMIT_NOFILE, &rlimit))}

Mysql gdb-101022041146-phpapp01