吾生有涯,而知无涯,适当止学.循序渐进,步步提升 Talk is cheap, show me the code.
分类: Mysql/postgreSQL
2017-11-15 08:52:55
MySQL server has gone away No connection. Trying TO reconnect...
Nov 1216:05:09 spider mysqld[763]: 091112 16:05:09 [Warning] Could not
increase number of max_open_files to more than 1024(request:1210)
------------------------------------------------------------------------------------------------
接着查看MySQL的open_files_limit为1024,如下:
mysql>SHOW VARIABLES LIKE'open%';+------------------+-------+| Variable_name | Value |+------------------+-------+| open_files_limit |1024 |+------------------+-------+1 row INSET(0.00 sec)在/etc/my.cnf加入open_files_limit=8192后重启MySQL后查看不起作用(重点在于操作系统的文件打开数是否够)接着查看了下系统默认的打开文件数
ulimit -n 1024在/etc/security/limits.conf添加
* soft nofile 8192 * hard nofile 8192重新登录并重启MySQL后查看
ulimit -n 8192SHOW VARIABLES LIKE'open%';+------------------+-------+| Variable_name | Value |+------------------+-------+| open_files_limit |8192 |+------------------+-------+1 row INSET(0.00 sec)再次跑程序异常消失。