On 11/10/2011 3:12 PM, Stefan Fritsch wrote:
Hi,

I intend to set MaxMemFree by default. The reason is that some modules use a 
lot of memory
for a few requests (e.g. mod_dav, mod_php). With MaxMemFree disabled, the 
allocators will
grow to the size necessary to serve the most memory intensive type of request 
and never
shrink again. And since we have one allocator per connection (on event) or one 
allocator
per thread or process (on worker/prefork), this can add up to insane amounts of 
memory. As
pointed out by a recent bug report, it is easy to make mod_dav use 50MB for a 
propfind
request. Multiply that by 1000 allocators...

I think 4MB could be a reasonable default for MaxMemFree.

Were you considering that in terms of a 64 or 32 bit arch?  Guessing
that from alignment and ptr sizes, there will be some impact.

We default[1] to 150, so 600MB would be the 'normal' profile of httpd.
That sounds awfully high for a default-per-worker threshold.  Most
requests should fit in 10's if not 100's of KB.  Even our stack size
per worker is tuned down to the 256KB range.

So maybe simply 1MB as a default for now?  Particularly if we will do
a final post-2.3.15 beta.

The biggest headache seems to me that most people can't see request
'sizes' in terms of heap.  I started playing with a snapshot feature
to show this in mod_status per score slot, but it wasn't trivial to
ask apr_pool_current_free_get() or apr_pool_current_size_get() (or to
write such functions when factoring in child pool usage).

Whatever the defaults in our /docs/conf/... tree, we should sync up
the server/mpm/ source defaults to the same values (see [1] again).
That should go for MaxMemFree as well.

[1] 
http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/extra/httpd-mpm.conf.in
looks like the OS2 needs further clarification, and netware has
some aberrant 250 instead of 150 by default?  Every MPM in that
file and by default should have an equivalent profile, IMHO.

Reply via email to