httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Tatarinov <>
Subject Re: [newtoy] mod_mmap_static.c
Date Sun, 25 Jan 1998 06:44:40 GMT
OK, Let's rock!

This is an mmap caching module for apache. But it's not static it 
has a hash table (the size is configurable) and gives the same improvement
upto 30% on zb.

I am still thinking about also adding a real file caching module
(file_cache) that would store copies of small files in memory.

The pluses of mmap_cache (and minuses of file_cache) are:
1) very simple
2) very robust (no concurrency)
3) doesn't require sync stuff

The pluses of file_cache (and minuses of mmap_cache) are:
1) provides shared access to cached data
2) persistent (mmap_cache dies along with the process).

I played with both mmap_cache and file_cache for some time on my own
simple http server and they both looked promising. BUT I didn't fstat
files AND using pfopen would result in two copies of data in file_cache:
to stdio buf to BUFF and then into the file cache. This sucks. 

But of course the main reason is that it might be a problem to make sure
clear state of the shared file cache. And of course there are no mutexes
and rwlocks on anything else but Solaris (I am thinking about writing my
own ones)

please try the module and let me know what you think.
Add something like this to httpd.conf:
MmapCacheSize 1000 (entries)

AddModule modules/cache/libcache.a
to Configuration (cache is the directory where I put the files)

I think after some minor tuning and fixing it should work fine.
(I tested the module on a 100K request trace and it seemed to work)
I only tried Solaris and Linux though.

I will look at Dean's new toy to check if I've missed anything


View raw message