Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 67079 invoked from network); 9 Mar 2005 17:48:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Mar 2005 17:48:41 -0000 Received: (qmail 87427 invoked by uid 500); 9 Mar 2005 17:48:37 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 87122 invoked by uid 500); 9 Mar 2005 17:48:36 -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 87109 invoked by uid 99); 9 Mar 2005 17:48:35 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of luca.regini@gmail.com designates 64.233.170.203 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.203) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 09 Mar 2005 09:48:34 -0800 Received: by rproxy.gmail.com with SMTP id y7so235830rne for ; Wed, 09 Mar 2005 09:48:32 -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=f1kKTVOL9o+M5sIApLYY43xKKbzFItCYCeck4p7Qj0EY1OtW5Lm/2ZG+xoNjwuCdeieekOkUWh+JfEIgymb8ykL536pJrqLt+2+j0ed2XqnUypTn8B5IznuYaVM2oSQQYDQ+uujI6H7T+VVNGqejYYR1nUfdYODEJbmevq+JeCE= Received: by 10.38.78.70 with SMTP id a70mr1020336rnb; Wed, 09 Mar 2005 09:48:32 -0800 (PST) Received: by 10.39.3.54 with HTTP; Wed, 9 Mar 2005 09:48:31 -0800 (PST) Message-ID: <64077c2805030909485256c3dd@mail.gmail.com> Date: Wed, 9 Mar 2005 18:48:31 +0100 From: luca regini Reply-To: luca regini To: dev@httpd.apache.org Subject: Re: Mod_MEM_cache doesn't use Pools to allocate cache objects??? In-Reply-To: <422DC00A.3000708@apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <64077c2805030803253052d927@mail.gmail.com> <422DC00A.3000708@apache.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I am going to use shared memory. I found a very good example in the ssl_scache_shmht.c file. This implementation has everything i need of. Now i am just working to remove dependencies that this code has on other mod_ssl files, so to provide a generic shared memory cache table object. I can release the source code to the group if there is some interest in it. If i manage to build a generic solution for the web service caching module i will release this source code also. Luca On Tue, 08 Mar 2005 16:08:58 +0100, Matthieu Estrade wrote: > luca regini wrote: > > > Taking a look at mod_mem_cache source code i have seen that it doesn't > > use pools to allocate cache objects but i does so by means of > > reference counting and simple calloc/free calls. I have also seen > > that this module requires a Threaded apr to work. > > > If you use prefork, each child is a fork and has it's own memory space, > so you are unable to share data between child -> bad idea > The way you can do is code a cache module using shared memory but in > this case, shm and rmm are not using pools, and i think there will be > performances issues. > > It depend on what you want to do with your cache module. Actually, in a > threaded mpm, each child and the threads inside are sharing common data. > So you have duplicated cache data in each forked child. The performance > depend on how you setup your server. low child number and high thread > number = few request on backend and only few duplicated data. > > Coding a cache module using shared memory is huge work. > Good luck if you choose to do it > > Matthieu > >