Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 58603 invoked from network); 20 Dec 2005 12:50:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Dec 2005 12:50:50 -0000 Received: (qmail 92516 invoked by uid 500); 20 Dec 2005 12:50:48 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 91676 invoked by uid 500); 20 Dec 2005 12:50:45 -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: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 91665 invoked by uid 99); 20 Dec 2005 12:50:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2005 04:50:45 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [82.195.155.60] (HELO dochas.stdlib.net) (82.195.155.60) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2005 04:50:44 -0800 Received: from colmmacc by dochas.stdlib.net with local (Exim 4.50) id 1Eogx8-00066y-SJ for dev@httpd.apache.org; Tue, 20 Dec 2005 12:50:50 +0000 Date: Tue, 20 Dec 2005 12:50:50 +0000 From: Colm MacCarthaigh To: dev@httpd.apache.org Subject: RFC: up-front memory allocation Message-ID: <20051220125050.GA22919@dochas.stdlib.net> Reply-To: colm@stdlib.net Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.9i X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I've been toying with adding some code that allocates a ton of memory to our connection pool at the start of the connection, to avoid any later malloc's/mmap's. Right now, I've just hard-coded the allocation, and keeping ap_max_mem_free at APR_ALLOCATOR_MAX_FREE_UNLIMITED and the results look promising, it certainly improves performance, though I havn't done detailed performance benchmarks yet. I'd been considering adding a directive to allow operators to specify an ammount of memory to allocate pre connection time (in the mpm code), such that they can avoid any later ones. This directive would require a fair amount of work on behalf of the operator, which a downside, it's not very easy to figure out an appropriate value to set it to. Ideally I'd like more intelligence, like the ability to query all of the loaded modules what they are likely to need allocated, but this isn't very easy since we can't predict what modules a connection (which isn't even a request yet) is likely to touch. So, is the rough solution something we could add to httpd? or any thoughts on a more clever approach? -- Colm MacC�rthaigh Public Key: colm+pgp@stdlib.net