Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 32445 invoked from network); 11 Oct 2006 03:16:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Oct 2006 03:16:34 -0000 Received: (qmail 62429 invoked by uid 500); 11 Oct 2006 03:16:34 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 62416 invoked by uid 500); 11 Oct 2006 03:16:33 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 62407 invoked by uid 99); 11 Oct 2006 03:16:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2006 20:16:33 -0700 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 [207.155.248.47] (HELO glatton.cnchost.com) (207.155.248.47) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2006 20:16:31 -0700 Received: from [192.168.1.100] (unknown [66.194.95.2]) (as wrowe@rowe-clan.net) by glatton.cnchost.com (ConcentricHost(2.54) Relay) with ESMTP id D8FE42CF519 for ; Tue, 10 Oct 2006 23:16:06 -0400 (EDT) Message-ID: <452C61F5.7040907@rowe-clan.net> Date: Tue, 10 Oct 2006 22:16:05 -0500 From: "William A. Rowe, Jr." User-Agent: Thunderbird 1.5.0.7 (X11/20060913) MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Re: server config apr_table_t References: <5b3fa8f0610091618y20905c5fxf2acfc58fc8c3689@mail.gmail.com> <5b3fa8f0610100843s69da8635ub29470fb00794fb2@mail.gmail.com> <452BFDA8.4000508@rowe-clan.net> <5280fae50610101655k75cb023ua3062ad4c632102b@mail.gmail.com> In-Reply-To: <5280fae50610101655k75cb023ua3062ad4c632102b@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N David Wortham wrote: > On 10/10/06, William A. Rowe, Jr. wrote: >> You are responsible for mutexing; and remember unless you alloc before >> fork and never modify the data, it's per-process private. > > Is this to say that using a subpool of a "s->process->pool" pool, what > mutations made by one child process won't be seen by other child > processes? All of them. Understand that all malloc()ed memory heap pages in most kernels are shared but marked copy-on-write. As soon as any forked process (every httpd child worker process) touches one byte in those pages, they get their own copy of the memory that's then modified. If you never write to pconf, then all child processes will continue to share the same, single copy. Until one writes to it, potentially chewing up alot of memory if there are many processes and many small changes in that pool. That's why I say touching the global pools such as pconf is just a bad idea. So if you can't share palloc()'ed memory - what to do? Use the apr_shm or apr_mmap interfaces to create shared memory segments across processes. > Right now, I have a module (based roughly off of mod_evasive 2.0 for > website RBLing and caching of recent RBL lookups). I'm using a file > for caching, but I would like to have my lookups stored in > parent-process memory so that each child process does not have to sync > to the file and keep its own lookup hashtable. gotcha > BTW - I'm new to the mailiing list. If I need to reformat or send > replies in some other manner, please inform me. Looks fine here