On Mon, Apr 30, 2001 at 03:20:17PM -0400, Cliff Woolley wrote: > > How do we decide that? Doesn't that depend on your OS and the size of > > the MMAP extents (imagine 2 2GB files in your cache - which may be fine > > on certain OSes but not on others - imagine 64bit address spaces). That > > is my inherent problem with using MMAP. > > To be more precise, "too many MMAPs" is not just a factor of sheer number, > it's (size1+size2+size3+...+sizen > OVERALL_MMAP_BYTES_LIMIT). I just > made that constant up, obviously, but apr_buckets_file.c defines > MMAP_LIMIT for its own purposes (if it's not already defined, that is), so > I see no reason that mod_file_cache couldn't similarly define a global > limit in the same vein. > > The file buckets code has a default MMAP_LIMIT for a given file of 4MB, > just to give you an idea. Any file bigger than that won't get MMAPed in > the first place, at least not by the buckets code. Multiply that times > some sane number of files you wish to have MMAPed at one time, and voila, > you've got your global limit for mod_file_cache. > > Right?
Correct, but wouldn't it be "fairly" expensive to calculate how much space you have allocated with MMAP? Or, you try and keep a static "cached" value of how much space you've allocated. I bet this might be a good place to use a reader/writer lock (wonder if anyone has implemented that - <G>). -- justin
