Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 92005 invoked from network); 2 Dec 2004 16:48:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Dec 2004 16:48:04 -0000 Received: (qmail 28582 invoked by uid 500); 2 Dec 2004 16:47:00 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 28458 invoked by uid 500); 2 Dec 2004 16:46:58 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 28407 invoked by uid 99); 2 Dec 2004 16:46:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of trawick@gmail.com designates 64.233.170.205 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.205) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 02 Dec 2004 08:46:57 -0800 Received: by rproxy.gmail.com with SMTP id i8so56534rne for ; Thu, 02 Dec 2004 08:46:55 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=H+R4GniX6U1s9WRlYu2wL6znpXa/6BPvz5Gc/ukNzjiIMwi9gdr3Q6+Eg9Z+WySYAW2qoSA6eFLR+QuZPi4tnlOjIcbSRv9CUSvnBqBr5CPp0+9L25PB7/lGuGNIJ1bDPCVYx0oeMpSXxF2wbgmVMfjAkMyhaRJD0toNZAJ+mPI= Received: by 10.38.82.2 with SMTP id f2mr891046rnb; Thu, 02 Dec 2004 08:46:55 -0800 (PST) Received: by 10.39.2.36 with HTTP; Thu, 2 Dec 2004 08:46:55 -0800 (PST) Message-ID: Date: Thu, 2 Dec 2004 11:46:55 -0500 From: Jeff Trawick Reply-To: Jeff Trawick To: dev@httpd.apache.org Subject: Re: How does MPM actually work? In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Thu, 02 Dec 2004 13:01:49 +0000, Scott MacVicar wrote: > Hi, > > I've been trying to get my head around the MPM module and I realise its > a hybrid of multi-threading and multi-processing. Can someone either > confirm what I'm saying or correct any obvious mistakes. > > 1 Main httpd process call this the parent process > X server processes call this the child processes > Y child threads > > the main httpd process handles the socket connections which passes it to > one of the server processes and once its been processed there any data > to be sent back to the client is handled by one of the child threads? parent process does not handle connections; it sets up the listening sockets at initialization, but only child processes will accept new connections > If so how do you pass data between the different processes, pipes or > shared memory? not done (caveat: perchild is a special beast that sends file descriptors over unix sockets from one child process to another; it is just an experiment and its behavior shouldn't confuse the issue) > I read about the various directives for the mpm module and had a look > through the code but I'm just trying to get a better understanding. If > there is a document somewhere that I've missed that explains this then > apologies. take worker MPM, for example each child process has a thread that listens for new connections; when it gets one, it uses apr_thread_cond*() APIs to dispatch a worker thread to handle that connection