You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Colm MacCarthaigh <co...@stdlib.net> on 2005/12/20 13:50:50 UTC
RFC: up-front memory allocation
I've been toying with adding some code that allocates a ton of memory to
our connection pool at the start of the connection, to avoid any later
malloc's/mmap's.
Right now, I've just hard-coded the allocation, and keeping
ap_max_mem_free at APR_ALLOCATOR_MAX_FREE_UNLIMITED and the results look
promising, it certainly improves performance, though I havn't done
detailed performance benchmarks yet.
I'd been considering adding a directive to allow operators to specify an
ammount of memory to allocate pre connection time (in the mpm code),
such that they can avoid any later ones. This directive would require a
fair amount of work on behalf of the operator, which a downside, it's
not very easy to figure out an appropriate value to set it to. Ideally
I'd like more intelligence, like the ability to query all of the loaded
modules what they are likely to need allocated, but this isn't very easy
since we can't predict what modules a connection (which isn't even a
request yet) is likely to touch.
So, is the rough solution something we could add to httpd? or any
thoughts on a more clever approach?
--
Colm MacCárthaigh Public Key: colm+pgp@stdlib.net
API module structure is garbled
Posted by Steffen <in...@apachelounge.com>.
Build the source httpd_20051220114954 (2.3.0-dev) from the svn repository on
Windows.
Third party add-in modules are given the error below, had to build them
again too:
httpd: Syntax error on line 35 of C:/Apache2/conf/httpd.conf: API module
structure `proxy_html_module' in file
C:/Apache2/modules/mod_proxy_html/mod_proxy_html.so is garbled - perhaps
this is not an Apache module DSO?
The MMN is the same as 2.2.0 : 20051115:0
Steffen
http://www.apachelounge.com
Re: RFC: up-front memory allocation
Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Tue, Dec 20, 2005 at 09:14:24AM -0500, Brian Akins wrote:
> Colm MacCarthaigh wrote:
> >I've been toying with adding some code that allocates a ton of memory to
> >our connection pool at the start of the connection, to avoid any later
> >malloc's/mmap's.
>
> I thought once the pools were "primed" there wouldn't have to be anymore
> allocation?
The exact behaviour is MPM-specific, but there are still plenty of cases
where that doesn't quite work out. In pre-fork the pool comes from the
per-child pool which is created afresh every time there's a new child.
In worker it's slightly more complicated, the pool is set up by
ap_queue_info_wait_for_idler() and we get a recylced pool from a list.
The code there now makes things more efficient, but it means early
requests are burdened with the allocations, and memory intensive but
less frequent requests are burdened with allocations too (this can be
common for the scripting modules).
--
Colm MacCárthaigh Public Key: colm+pgp@stdlib.net
Re: RFC: up-front memory allocation
Posted by Brian Akins <br...@turner.com>.
Colm MacCarthaigh wrote:
> I've been toying with adding some code that allocates a ton of memory to
> our connection pool at the start of the connection, to avoid any later
> malloc's/mmap's.
I thought once the pools were "primed" there wouldn't have to be anymore
allocation?
--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies