mysql_connect can't create a new thread

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am continualy receiving the following type of error in my browser
from programs using php/mysql

Warning: mysql_connect(): 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 in
on line 318

Cannot connect to MySQL server on 'localhost'. Please make sure you
have specified a valid MySQL database name in 'include/config.php'.

This requires me to do a manual kill and restart of mysql as it won't
restart gracefully. mysqld itself does not appear to be crashed but I
am getting the above error on all sites using mysqld (eg oscommerce,
plesk controlpanel) and need to restart it to get the sites working
The mysql server version is mysql-3.23.58-1.9 and php is php-4.3.4. In
mysql I have increased the max_connections to 1024.

I am also receiving the following strange error and received it about
140 time in the last 24 hours in my httpd error_log (on RedHat 9
Apache/2.0.40 )

ERROR: can't parse '#FF0000:Busy'

There are no other associated errors or strange errors in the Apache
error logs.

Does anyone have any ideas that may help?



Re: mysql_connect can't create a new thread

Quoted text here. Click to load it
Quoted text here. Click to load it

Without looking at mysqls documentation (like the error suggests (and
which you did?))...

Increasing max connections alone is not enough. The user running the
apache/mysql must get permission to run that many processes. To find out
if there are limits you should run ulimit as that user. A typical output
of ulimit -a (debian):

core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 1024
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) 8192
cpu time             (seconds, -t) unlimited
max user processes            (-u) unlimited
virtual memory        (kbytes, -v) unlimited

It limits my open files to 1024... each mysql connection/thread probably
has at least 1 file opened, but I have not limit on processes (which a
thread also counts as on linux)...


  Daniel Tryba

Site Timeline