Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
    
Check mysqltuner.pl/mysqltuner.pl as a way to find out what your estimated max usage is, and possible suggestions to fix the problem. –  Glen Solsberry Mar 2 '12 at 15:46

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
    
max used is about 1050. shouldn't the memory usage show up in the memory graph from collectd? i.imgur.com/FVXla.png –  Adrian Mester Mar 1 '12 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 '12 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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