MySQL数据库如何计算打开文件数(3)_MySQL数据库_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

MySQL数据库 如何计算打开文件数(3)

作者:黑客防线网安MYSQL维护基地 来源:黑客防线网安MYSQL维护基地 浏览次数:0

本篇关键词:打开文件计算如何
黑客防线网安网讯:  而这个时候,按计算公式结果如下:  | max_connections | 100 |  | table_open_cache | 1000 |  来计算一下:  max_open_files_1 = max_connections + table_cache * 2 = 100 +...

  而这个时候按计算公式结果如下:

  | max_connections | 100 |

  | table_open_cache | 1000 |

  来计算一下:

  max_open_files_1 = max_connections + table_cache * 2 = 100 + 1000 * 2 = 2100

  max_open_files_2 = max_connections*5 = 100 * 5 = 500

  6. 修改 ulimit 试试看:


  unlimit -n 5000
  vi /etc/my.cnf
  ...
  open_files_limit = 10000
  ...
  /etc/init.d/mysql restart
  mysql>show global variables like '%open%';
  | open_files_limit | 10000 |
  | table_open_cache | 1000 |


  open_files_limit 比内核最大限制数还大因此以 open_files_limit 为准
   vi /etc/my.cnf
  ...
  #open_files_limit = 10000
  ...
  /etc/init.d/mysql restart
  mysql>show global variables like '%open%';
  | open_files_limit | 5000 |
  | table_open_cache | 1000 |
  看到了,变成了新的内核最大限制

  看到了吧,结果完全跟文档描述的以及mysql源码中写的不一样,看来预编译版本有些地方不太可靠啊 :(

  以上测试在mysql 5.1.23-rc(预编译), mysql-5.1.24-rc(自编译) 以及 5.0.45(预编译) 均一样


  uname -a
  Linux s1.yejr.com 2.6.9-55.ELsmp #1 SMP Fri Apr 20 16:36:54 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
  mysql> select version();
  +---------------+
  | version() |
  +---------------+
  | 5.1.23-rc-log |
  +---------------+

 

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-8918-1.html
网站维护教程更新时间:2012-03-20 05:02:56  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer