Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 2618 invoked by uid 6000); 27 Feb 1999 04:10:31 -0000 Received: (qmail 2610 invoked from network); 27 Feb 1999 04:10:30 -0000 Received: from fwns1d.raleigh.ibm.com (HELO fwns1.raleigh.ibm.com) (204.146.167.235) by taz.hyperreal.org with SMTP; 27 Feb 1999 04:10:30 -0000 Received: from rtpmail02.raleigh.ibm.com (rtpmail02.raleigh.ibm.com [9.37.172.48]) by fwns1.raleigh.ibm.com (8.9.0/8.9.0/RTP-FW-1.2) with ESMTP id XAA26568 for ; Fri, 26 Feb 1999 23:10:25 -0500 Received: from webdev7.raleigh.ibm.com (webdev7.raleigh.ibm.com [9.37.72.37]) by rtpmail02.raleigh.ibm.com (8.8.5/8.8.5/RTP-ral-1.1) with ESMTP id XAA35816 for ; Fri, 26 Feb 1999 23:10:27 -0500 Date: Fri, 26 Feb 1999 23:01:02 -0500 (EST) From: Ryan Bloom To: new-httpd@apache.org Subject: Re: new acceptor logic. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org > OK, we can probably agree that situations where there isn't always a new > connection ready to be accepted (or fd already accepted) when a worker > thread finishes a previous connection are not interesting -- the load > isn't high enough to saturate the server, so sleeping we don't care about. Agreed. > Am I still missing something? I'm not sure we are talking about the same case. I agree, your method will work better than mine when we are only accepting on one socket, and I do plan to implement this at some point. However, what about multiple sockets. I see two options: 1) Using a counting mutex, we let N threads in to accept on N sockets. Inside the mutex, we grab another mutex and look for a socket to listen on in an array of sockets. When we find one, we update the array of sockets. Release the mutex. Accept on the socket and serve the request. 2) All Threads block on one mutex. When they get the mutex, they do a select to find a socket that has data coming in. Do the accept, serve the request. On every system we have looked at, select is a very expensive operation, and causes a performance hit. We haven't done any real acurate benchmarking yet, but that is in the plan. I will implement both of these as soon as I have a chance, and then we can do some benchmarking to determine the best method. I believe we have to compare algorithms that will accept connections on multiple sockets. Ryan