Seems I was in error suggesting a file limit issue; which is why I wisely
left it to to, Jörg. :)

Ok, next step, then:

ERRORS
 pthread_create() will fail if:

[EAGAIN] The system lacked the necessary resources to create
         another thread, or the system-imposed limit on the
         total number of threads in a process
         [PTHREAD_THREADS_MAX] would be exceeded.

Which brought me to the likely solution:

http://www.krellis.org/unix-stuff/mysql-freebsd-threads.html

My system only needs 128 connections (as opposed to the 2000 of the OP),
so I guess that's why I never ran into this.

- Mark



-----Original Message-----
From: joerg.bru...@sun.com [mailto:joerg.bru...@sun.com] 
Sent: woensdag 29 april 2009 8:14
To: Mark; mysql@lists.mysql.com
Subject: Re: 1135: Can't create a new thread (errno 35); if you are not out
of available memory, you can consult the manual for a possible OS-dependent
bug

Hi all!


Mark wrote:
> On my FreeBSD:
> 
> usr/include/errno.h:#define EAGAIN  35 /* Resource temporarily unavailable
> */
> /usr/include/errno.h-#ifndef _POSIX_SOURCE
> /usr/include/errno.h-#define EWOULDBLOCK EAGAIN /* Operation would block
*/

Ok, next step then:

The OP wrote the problem was when creating a new thread.
From some obscure sources (personal knowledge, reading, wild guess, ...)
we assume it might be a system call "pthread_create()" which is used for
this.

So we do a "man pthread_create" and get (quoted from my Linux machine):
|  NAME
|         pthread_create - thread creation

Looks good! Continuing reading that page, we arrive at (again, from Linux):
| ERRORS
|        The pthread_create() function shall fail if:
|
|        EAGAIN The  system  lacked  the  necessary resources to create
another thread, or the system-imposed
|               limit on the total number of threads in a process
{PTHREAD_THREADS_MAX} would be exceeded.
|

I leave it to the OP (or other users of his system, FreeBSD 7.1) to
1) check the man page there for the exact description when
   "pthread_create()" might cause error EAGAIN,
2) find out which resources that might be, or which system limit, and
   how to check more, maybe even change the limits.

> 
> I still wouldn't discount the files resources limit; though obviously
> I bow to Jörg's expertise on the matter. :)

Thanks :)

I never claimed it wouldn't be files, I just said that using the errno
value reported will help in the analysis (and tried to explain how to do
that).

But if somebody finds that the message
  "*1135: Can't create a new thread (errno 35); if you are not out of
   available memory, you can consult the manual for a possible
   OS-dependent bug*"
really is caused by a file limit, I propose to report a bug about a
misleading error message.


Regards,
Jörg

-- 
Joerg Bruehe,  MySQL Build Team,
               joerg.bru...@sun.com
Sun Microsystems GmbH,   Sonnenallee 1,   D-85551 Kirchheim-Heimstetten
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering     Muenchen: HRB161028


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=ad...@asarian-host.net


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to