目前,我正在使用Amazon Linux对AWS EC2上托pipe的PHP,MySQL应用程序进行压力testing。 达到一定数量的用户后,DB开始出错: 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 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 。 我的系统上还有很多内存空闲,当我收到这个错误时,我可以用free -m看到。
我试图在/etc/security/limits.conf更改mysql限制,但没有成功。 我还有什么可以尝试? 我怎样才能达到这个问题的根源? 是的,我是MySQL和Linux的新手。
更新:在回答了jeffatrackaid之后,我尝试在目录/etc/security/limits.d添加一个名为99-mysql.conf的configuration文件,但是错误仍然存在。 以下是该文件的内容:
mysql soft nproc 20960 mysql hard nproc 45960 mysql soft nofile 20960 mysql hard nofile 45960 root soft nproc 20960 root hard nproc 45960 root soft nofile 20960 root hard nofile 45960
更新:在系统重启后工作。
你在正确的轨道上,但在一些较新的操作系统(如CentOS 6),有一个:
/etc/security/limits.d/
这将覆盖放在limits.conf中的项目。
我build议在这里用一个更高的数字文件(例如99-mysql.conf)来限制它。
欲了解更多信息,请访问: http : //www.mysqlperformanceblog.com/2013/02/04/cant_create_thread_errno_11/