MySQL 用户并发数限制问题解决

对MySQL进行并发测试过程中遇到的一个小问题,记录一下。

用mysqlslap进行并发访问测试,在1024线程的时候报错:

bin/mysqlslap: Error when connecting to server: 1135 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

Linux系统的open files数已经修改。当然仍然报错。ulimit -a命令,可查看当前系统限制情况

max user processes = 1024


通过ulimit -u 10000命令修改当前session的限制值,然后重启MySQL,问题解决。如果你想使此值永久生效,可配置在/etc/profile 中。

Thanks a lot.