We have a dedicated MySQL server with 16GB of RAM that's serving 8 web workers with relatively high traffic (over 1000 requests per second at peak traffic)

At peak we're seeing the following errors in the web server's error logs:

SQLSTATE[HY000] [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

Here's a pastebin of my.cnf

I've also uploaded some graphs from collectd to an imgur album as well as a screenshot from mysqlcalculator.com with my settings (you might want to open them in a new window because the background is transparent and the text isn't very visible on imgur's dark background)

As you can see, very little memory is actually used (under 6GB if you exclude cached). mysqlmemorycalculator says 10GB.


2 Answers 2


For every new MySQL connection from a Client, some amount of memory will be used. So once the number of connections (which uses RAM) exceeds, you will be getting this error.

So check your application whether the connections are properly closed after using.

Also check what is the max_used_connections status variable and check whether that many connections are really getting connected from application. If application is not using that many number of connections, then it is definitely connection leak.

  • max used is about 1050. shouldn't the memory usage show up in the memory graph from collectd? i.imgur.com/FVXla.png Mar 1, 2012 at 15:44
  • Yes, In the graph, the memory usage is around 6GB and your configuration is 10GB. So total is 16 GB. As once the memory is reaching 6 GB, it is throwing this kind of error.
    – Phanindra
    Mar 2, 2012 at 6:04

I spent the entire day solving this MySQL error. The solution (taken from different places on the web) was to change the limits in /etc/security/limits.conf.

In my case this didn't fully resolve the issue since we use a Virtual Private Server that had hard limits imposed on a container. This limit was not visible from the Linux itself, but only from VPS control panel. To save time please check if you have any such VPS limit.

  • Hi - could you share what those values were which you set in limits.conf?
    – siliconpi
    Dec 18, 2015 at 2:19
  • 1
    It was long time ago and I do not remember. Because of VPS provider low limits we moved to a new one where default values were enough to make the web app work.
    – ssasa
    Dec 18, 2015 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.