2. 起源
> Can't open file: '.testmytable.frm' (errno: 24)
shell> perror 24
OS error code 24: Too many open files
尝试修改open_files_limit
Changes 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.
3. open_files_limit in my.cnf
• 配置open_files_limit = 10000
global variables like "%open_files_limit%";
+------------------+-------+
| open_files_limit | 1024 |
+------------------+-------+
• 配置open_files_limit = 30000
global variables like "%open_files_limit%";
+------------------+-------+
| open_files_limit | 1024 |
+------------------+-------+
参数设置始终无效
5. gdb: watch
gdb mysqld
(gdb) watch open_files_limit
(gdb) r
Old value = 0
New value = 20000
Old value = 20000
New value = 1024
init_common_variables (...) at mysqld.cc:3355
10. Almost Done
• mysqld_safe
if test -w / -o "$USER" = "root"
then
......
if test -n "$open_files"
then
ulimit -n $open_files
append_arg_to_args "--open-files-limit=$open_files"
fi
fi