From owner-freebsd-threads@FreeBSD.ORG Tue Jan 27 06:21:46 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E93516A4CF for ; Tue, 27 Jan 2004 06:21:46 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A584943D48 for ; Tue, 27 Jan 2004 06:21:24 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i0REL6iw024951; Tue, 27 Jan 2004 09:21:06 -0500 (EST) Date: Tue, 27 Jan 2004 09:21:06 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Julian Elischer In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: "maxthr" state X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2004 14:21:46 -0000 On Tue, 27 Jan 2004, Julian Elischer wrote: > > On Tue, 27 Jan 2004, Daniel Eischen wrote: > > > On Mon, 26 Jan 2004, Craig Rodrigues wrote: > > > > > 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). > > > > Remember though that kern.threads.max_threads_per_proc are the > > number of kernel threads for the process, not the number of > > userland threads. Threads blocked in userland don't consume > > a kernel thread. On the other hand, if the threads are IO > > bound, they will get blocked in the kernel and consume a > > kernel thread. > > We are limitted by hardware to 8191 kernel threads on x86 > but that could be a LOT of user threads.. Using libkse, you are limited to 8191 KSEs, not threads. You can have as many threads for which you have the (other) resources :) > > Hmm how many 64k stacks can you fit in 2GB? > hmmmm 2^16 into 2^31... well that limits us to 32k threads :-) -- Dan Eischen