Bug #7902 Same Error as Bug # 5656 but different Problem !
Submitted: 14 Jan 2005 10:39 Modified: 14 Feb 2005 17:39
Reporter: Anand K Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: ISAM storage engine Severity:S3 (Non-critical)
Version:4.1.8-standard OS:Linux (RHEL ES rel 3.0 ;2.4.21-20.ELsmp)
Assigned to: CPU Architecture:Any

[14 Jan 2005 10:39] Anand K
Description:
[root@newdb root]# mysql
ERROR 1135 (00000): 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 Memory at this time:
             total       used       free     shared    buffers     cached
Mem:       3599032     554856    3044176          0      39404     213856
-/+ buffers/cache:     301596    3297436
Swap:      4194224          0    4194224

load average: 0.34, 0.46, 0.37

Variable_name: max_connections
Value: 1200
Variable_name: key_buffer_size
Value: 8388600
Variable_name: sort_buffer_size
Value: 1048568
Variable_name: read_rnd_buffer_size
Value: 262144
Variable_name: read_buffer_size
Value: 1044480

The problem occurs serveral times in a day .. as soon as the number of connections gets close to 1000. It will knock off a couple of connections and then everything will be alright. 

The calculation formula in Bug# 5656 does not work for me. I have also checked the file handlers and all that:

[root@newdb root]# cat /proc/sys/fs/file-nr 
1222    1044    366996
[root@newdb root]# 

How to repeat:
On my box only .. the moment the number of connections gets close to 1000
[14 Jan 2005 10:42] Anand K
Show Varibales Command

Attachment: show_variables.txt (text/plain), 21.63 KiB.

[14 Jan 2005 14:02] Martin Friebe
Hi Anand,

available memory is not all. some op systems have individual limits about the code/data/stack size a process (or process group) can have. which you are likely to hit.
Unfurtunatley I dont know any good documentation for any op system on this issue. Neither am I a linux expert.

However the linuxthread library (under freebsd) allocates stack size to each thread. that might be similiar under RHEL. You might have it a limit configured in you Kernel. (the freebsd option is MAXSSIZ and with it set to 1GB I can have 800 connections)

TO the msysql team: Even so thsi is not a problem of the amysql software, it would be nice to have a resource limitations and configurations section in the operating system pages, of the documentation.
[14 Jan 2005 17:39] Hartmut Holzgraefe
The formula given in #5656 did not take the thread stacks into account,
these take 256K each with static binaries released by MySQL that 
is linked againsta patched glibc and 2MB for binaries using regular 
glibc versions.

1000 connections * 2MB -> 2GB alone which might already cause trouble

but it might also be that number of processes or threads  is limited
or that you are just running out of file descriptors (although that should
give a different error message afair)
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".