Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 73744 invoked from network); 28 Aug 2008 01:30:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Aug 2008 01:30:09 -0000 Received: (qmail 68621 invoked by uid 500); 28 Aug 2008 01:30:06 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 68590 invoked by uid 500); 28 Aug 2008 01:30:06 -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 68578 invoked by uid 99); 28 Aug 2008 01:30:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Aug 2008 18:30:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cesarbs@gmail.com designates 209.85.198.246 as permitted sender) Received: from [209.85.198.246] (HELO rv-out-0708.google.com) (209.85.198.246) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Aug 2008 01:29:07 +0000 Received: by rv-out-0708.google.com with SMTP id c5so126678rvf.24 for ; Wed, 27 Aug 2008 18:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=QjXuIgFaf0Hof0qgd4zbhNfECgVJv8wnda6wMgFspQk=; b=L2y9aeQ+BXVnzavT1XabkueHAVBBaDSkGz7nUHC3wHZLNktIbNSeakcF4AGdlLwQ3A pWif5vGwAuZkAuTaEcZcFz6sDNBCmdgL/xYzAIClhE//H1zxeRCM5mwGFEFlyu0gZL4J RvBG9vZOpk18H1qfMTtEqGhpLRgIPHJbltBIo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bN9Zcx/+jW2sZzFYJ99CY9C6ul8TQxGJhPQM35JHsVw7Wwrs2XNzl3uhjOLQzcC8/+ y1keNUQNXEdJ3WOOTy7bzsXY/P0Eekq5AtnbrYm22dus+KLt1N2FsPybv/KkjaBVgFCj QOlAWM8HVwsrJUbgRdugLZF4vByt0+u50ys3c= Received: by 10.114.177.1 with SMTP id z1mr736696wae.226.1219886968228; Wed, 27 Aug 2008 18:29:28 -0700 (PDT) Received: by 10.114.89.6 with HTTP; Wed, 27 Aug 2008 18:29:28 -0700 (PDT) Message-ID: Date: Wed, 27 Aug 2008 22:29:28 -0300 From: "=?ISO-8859-1?Q?C=E9sar_Leonardo_Blum_Silveira?=" To: modules-dev@httpd.apache.org Subject: Re: Global Data In-Reply-To: <5B0ECC1928CB6C479A734A6BD6209EF0017C40D7@exchange.Giant-Steps.local> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <5B0ECC1928CB6C479A734A6BD6209EF0017C40D6@exchange.Giant-Steps.local> <5B0ECC1928CB6C479A734A6BD6209EF0017C40D7@exchange.Giant-Steps.local> X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Aug 12, 2008 at 3:50 PM, Harold J. Ship wrote: > I'm in the middle of porting an application from IIS/Windows to Apache 2.= 2 module. In the application, there is a lot of global data. The data conta= ins both: > > - application configuration that is read on startup and on receiving a ce= rtain HTTP request to reload > - per-request data that is shared between certain requests with dependenc= ies. > > Other important information: > - The config data is very large, many MB > - The data structures are built with a lot of pointers to structs to poin= ters ... > - We are using the worker MPM. > I believe this is sort of an ugly hack, but if you're not expecting too much traffic to your application, you may limit the number of child processes of the worker MPM to just 1. That way, you can safely use global data in your module, since all threads of that process will share the same memory space. > My question is, how can we be sure that the data is stored only once on t= he machine, and accessible by any request that needs it? > > For instance, if we store it in the server pool, and we have multiple pro= cesses, how can the request data be shared? > If we have to reload the configuration data, will each process need to ma= intain its own copy? > If we use shared memory, we will have to change a lot of code which today= allocates data on the heap. > > One idea for the request data: is there a way to direct a request to be h= andled by a specific process? > > Harold Ship > Team Leader, Giant Steps Networks > 04-678-3440 extension 106 > harold@giant-steps-networks.com > > > --=20 C=E9sar L. B. Silveira http://www.cesarbs.org/blog