httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luca regini <luca.reg...@gmail.com>
Subject Re: Mod_MEM_cache doesn't use Pools to allocate cache objects???
Date Wed, 09 Mar 2005 17:48:31 GMT
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
<mestrade@apache.org> 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
> 
>

Mime
View raw message