"maxthr" state

Craig Rodrigues rodrigc at crodrigues.org
Mon Jan 26 21:49:01 PST 2004

On Fri, Jan 23, 2004 at 03:25:19PM -0800, Julian Elischer wrote:
> On Fri, 23 Jan 2004, Alex Boisvert wrote:
> > 
> > Nevermind, I discovered the kernel sysctl 
> > "kern.threads.max_threads_per_proc" with default value 150.  I bumped 
> > the value to 300 and the app runs fine.  (We simulate 250 clients with 
> > 250 connections or threads, hence the need for a large value...)
> yes, the number could be made bigger but we didn't want to make it
> too easy for wildly out-of-control threadded programs to
> kill the system while the threading system is still "young"..

150 is a perfectly reasonable number to start with, but I can see it 
could be a problem later on when KSE goes "live".
Due to programming languages like Java, there are a lot
of threads-happy coders out there (unfortunately).

I ran into this problem a few years ago when working in a group
that had a multithreaded Java server on AIX.  On AIX 4.2,
it would crash because the max threads per process was 256,
but on AIX 4.3, the limit was 32768 and things were fine.

Not pretty, but this gives you an idea of the kind of
multithreaded code that is being written out there....
people may complain why their multithreaded Java apps don't
work nicely on FreeBSD. :( 

Craig Rodrigues        
rodrigc at crodrigues.org

More information about the freebsd-threads mailing list