Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 79789 invoked by uid 500); 24 Jul 2001 18:45:55 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 79774 invoked from network); 24 Jul 2001 18:45:55 -0000 Date: Tue, 24 Jul 2001 11:45:32 -0700 From: Aaron Bannert To: new-httpd@apache.org Subject: Re: OSDLab projectL Accept() locking on large (6+ CPU) boxes Message-ID: <20010724114532.M28176@ebuilt.com> References: <20010724110730.L28176@ebuilt.com> <3B5DBF39.2000609@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B5DBF39.2000609@pacbell.net>; from bpane@pacbell.net on Tue, Jul 24, 2001 at 11:32:25AM -0700 X-AntiVirus: scanned for viruses by AMaViS 0.2.1-pre3 (http://amavis.org/) X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Tue, Jul 24, 2001 at 11:32:25AM -0700, Brian Pane wrote: > Aaron Bannert wrote: > > >Hi Dirk, > > > >I realize that the OSDlab is [primarily] linux machines, but something > >that you might want to look into on Solaris with larger-parallel > >machines is the pthread_setconcurrency() call, which AFAIK is not > >being called anywhere in httpd or apr. > > > >I quoth from the (Solaris 5.8) man page: > > > > Unbound threads in a process may or may not be required to > > be simultaneously active. By default, the threads implemen- > > tation ensures that a sufficient number of threads are > > active so that the process can continue to make progress. > > While this conserves system resources, it may not produce > > the most effective level of concurrency. > > > > > >My interpretation of this is that by default on solaris, pthreads remain > >a wholly userspace entity (ie they multiplex one LWP) unless we give a > >hint to the OS for how many LWPs we'd like to be able to assign to our > >userspace threads. > > > Are you able to observe this effect experimentally too? E.g., if > you run the threaded MPM on Solaris, does it use just one LWP per > process? I have observed this under conditions where the scheduling was multiplexed with a pthread_mutex (and only on a uniprocessor machine), but AFAIK we don't always use pthread_mutex to multiplex access to the accept() call (ie we don't have to use it when there is no "thundering herd" problem). ISTR apache-1.3 used fcntl() as the global-locking mechanism that multiplexed calls around a "thundering herd" accept() call. All of these issues, in my mind, could alter the way the OS decides to schedule blocked LWPs that receive an event. I will try to do some tests later today on our 2-way solaris machines to see if the CPU usage seems to favor one process over another, and then I'll observe the usage under the same load with pthread_setconcurrency() stuck in there somewhere. The hard part about this (at least for me) is the multitude of variables that go in to deciding the implementation of the accept() mutex. Is there a way I can find out (at runtime) what implementation is being used? -aaron