最大打开文件(FreeBSD 7.0上的MySQL 5.0)

我得到“无法打开文件:”./databasename/tablename.frm“(errno:24)”从MySQL的错误,但据我所知,我已经设置了必要的限制远高于我需要的。

除了kern.maxfileskern.maxfilesperproc sysctl和open_files_limit MySQLvariables之外,还有其他的限制会被踢进去吗?

 $ mysql -u root -p -e 'SHOW STATUS' | grep '^Open' Enter password: Open_files 356 Open_streams 0 Open_tables 245 Opened_tables 0 $ mysql -u root -p -e 'SHOW GLOBAL VARIABLES' | grep 'open_files_limit' Enter password: open_files_limit 18000 $ sysctl -a | grep kern.maxfiles kern.maxfiles: 20000 kern.maxfilesperproc: 18000 $ limits -n -U mysql Resource limits for class default: openfiles infinity 

问题看起来更像是一个错误,而不是碰到一个限制。
唯一的build议是更新到最新的稳定的MySQL版本,甚至到FreeBSD 7.2(他们几乎所有的限制在FreeBSD 7.2 amd64上)

什么是你的max_connections设置? 对于每个连接,一个(或多个)文件将被打开。 尽量减less。 另外table_cache设置可以影响打开文件的数量。 请参阅mysql手册获取更多帮助。

CU,arnep