mysql中一个普通ERROR 1135 (HY000)错误引发的血案
今天接到测试人员反应,测试环境前端应用程序无连接mysql数据库,登录mysql服务器,查看错误日志,发现有如下报错:
ERROR 1135 (HY000): Can't create a new thread (errno 11);if you are not out of available memory,you can consult the manual for a possible OS-dependent bug
第一反应感觉可能是跟ulimit限制连接数有关,文件描述符不够用。接下来检查配置件 /etc/security/limits.conf 相关结果如下:
#for root
root soft nofile 65535
root hard nofile 65535
# End of file
mysql soft nproc 65536
mysql hard nproc 65536
mysql soft nofile 65535
mysql hard nofile 65535
配置没有问题,mysql的ulimit限制已经打开。
但是,执行如下命令:
# sudo -u root bash -c " ulimit -a "
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 62591
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
发现max user processes值仍为1024.
而在Centos5里面,只须在/etc/security/limits.conf添加如下两行:
点击(此处)折叠或打开
root soft nofile 65535
root hard nofile 65535
对应的uilmit -u 就会是65535.
后来猜想centos6的用户的ulimit限制是不是还有其他的配置文件做相关的限制呢?果不其然,发现在 /etc/security/limits.d/目录下,有一个名为:90-nproc.conf的配置文件,
打开看看什么内容:
[root@fztest ~]# cat /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 1024
以上是 mysql中一个普通ERROR 1135 (HY000)错误引发的血案 的全部内容, 来源链接: utcz.com/z/346925.html