Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 441EF200D25 for ; Sun, 22 Oct 2017 23:15:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 42981160BD7; Sun, 22 Oct 2017 21:15:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 88F9B1609E1 for ; Sun, 22 Oct 2017 23:15:30 +0200 (CEST) Received: (qmail 72732 invoked by uid 500); 22 Oct 2017 21:15:29 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 72722 invoked by uid 99); 22 Oct 2017 21:15:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Oct 2017 21:15:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 6D7D81806C0 for ; Sun, 22 Oct 2017 21:15:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.378 X-Spam-Level: X-Spam-Status: No, score=0.378 tagged_above=-999 required=6.31 tests=[NO_DNS_FOR_FROM=0.379, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 55Xu--9DBbKS for ; Sun, 22 Oct 2017 21:15:26 +0000 (UTC) Received: from thor.wissensbank.com (thor.wissensbank.com [81.169.250.120]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 6C3E25FBE6 for ; Sun, 22 Oct 2017 21:15:25 +0000 (UTC) Received: from thor.wissensbank.com (localhost [127.0.0.1]) by thor.wissensbank.com (Postfix) with ESMTP id 4A9C93DC82C5F for ; Sun, 22 Oct 2017 23:15:17 +0200 (CEST) Received: by thor.wissensbank.com (Postfix, from userid 500) id 3C1DE3DC82C60; Sun, 22 Oct 2017 23:15:17 +0200 (CEST) Received: from [192.168.245.129] (p57BA1776.dip0.t-ipconnect.de [87.186.23.118]) (Authenticated sender: andre.warnier@ice-sa.com) by thor.wissensbank.com (Postfix) with ESMTPA id 2BB423DC82C5F for ; Sun, 22 Oct 2017 23:15:15 +0200 (CEST) Subject: Re: Shared var between processes To: modperl@perl.apache.org References: <9821FF17-7196-4644-B04B-18824978916C@gmail.com> <0fdeb6bf-3036-7359-e42b-035dafaeeca2@utoronto.ca> <8738480F-BB7E-4160-AF5C-5871E2603266@gmail.com> <59E9B621.5020206@ice-sa.com> <59E9BF45.6090903@ice-sa.com> <15d27b7c-03b0-f7dc-4c57-0ee0110478a2@utoronto.ca> <59EAEED3.4090304@ice-sa.com> <59EC730B.8070000@ice-sa.com> From: =?UTF-8?Q?Andr=c3=a9_Warnier_=28tomcat=29?= Message-ID: <59ED0A62.3070505@ice-sa.com> Date: Sun, 22 Oct 2017 23:15:14 +0200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP archived-at: Sun, 22 Oct 2017 21:15:31 -0000 On 22.10.2017 18:59, John Dunlap wrote: > In our case, we do not use Windows for anything. Even our desktops are Linux. We already > employ Redis, which performs the same function as memcache, however, this doesn't really > solve the problem because each virtualhost also relies on its own redis database so, even > in that case, we would still need a per virtualhost configuration mechanism to tell us > which redis database to use. > > At present, I kinda like Ben Rubson's suggestion of a read only hash in a startup script > which is keyed by hostname Yes, no doubt about that. But this does not answer the question : where do you store this hash (or a reference to it), so that a handler, later, would have access to it ? startup_script : my $big_hash = { hostname1 => { ... }, hostname2 => { ... }, }; # save $big_hash "somewhere" exit; ... later ... sub handler { # how do I access $big_hash ? (where is it ?) return OK; } > > On Sun, Oct 22, 2017 at 6:29 AM, André Warnier (tomcat) > wrote: > > On 22.10.2017 09:45, Ben RUBSON wrote: > > On 21 Oct 2017 08:53, André Warnier (tomcat) wrote: > > On 20.10.2017 17:15, Adam Prime wrote: > > On 17-10-20 05:17 AM, André Warnier (tomcat) wrote: > > On 20.10.2017 10:50, Ben RUBSON wrote: > > On 20 Oct 2017 10:38, André Warnier (tomcat) wrote: > > I believe that there is much more of a performance hit, when asking > the server to set up > an environment ($ENV) for sub-processes, than via the PerlSetVar > mechanism. > > > You don't need to use $ENV. If you're using handlers you could use > $r->server()->server_hostname. > > You could certainly create a big hash at startup and grab stuff out of it > that way, where > the top level key is the hostname. > > > Assuming that you wanted to do this, where would you put this big hash, so > that it is > persistent across requests, and can be accessed by mod_perl handlers ? > > > If it's a read-only hash, then a startup script (PerlPostConfigRequire) as Adam > proposed > before seems to be the right way. > > > Yes, but where exactly do you keep that hash, so that it is accessible later on by > mod_perl handlers ? (across requests) > > > > > -- > John Dunlap > /CTO | Lariat/ > / > / > /*Direct:*/ > /john@lariat.co / > / > *Customer Service:*/ > 877.268.6667 > support@lariat.co