httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wortham" <>
Subject Re: load data at server startup - is ap_hook_post_config() the right place?
Date Fri, 23 Mar 2007 18:39:06 GMT
    AFAIK, "mutex" refers to mutual exclusion.  It is commonly referred to
in relation to multi-threading but can apply to an inter-process scheme
too.  I would assume that only one thread of one (child) process can access
a given resource at a given time, but you should refer to the documentation
of any code you use for those specifics.  I'm sorry, but I don't have any
personal experience with mutex and the APR libs.

   Are you talking about adjusting your Apache child/thread setup for
development or are you targeting your module to only Apache installations
with specific configuration (i.e. single-thread mode)?
If you are worried about the size of a child process' server_config_struct,
you could just program it to take a lot of room in the server_config_struct
and recommend that Apache be configured for only one child-process.  I would
recommend against it, but it doesn't seem like a terrible idea.  There will
probably be significant performance hits on certain OSes/Apache-deployments
(*NIX) and less on others (likely WinNT since I believe it defaults to a
single-child process with a large thread-count).

   Also, what are you using this giant list of URIs for?  There may be a
more efficient way of distributing the processing load (and, therefore,
speeding up the overall Apache response time).  If I read your first post to
this list correctly, you are using a table (as in apr_table_*, a DB table,
or other?) with a large number of URLs.  You aren't walking through a
sequential list of URLs in apr_tables are you?  Are the "URI"s you're
storing full URIs, domain names, or MXs?  Perhaps you could use some help
with your overall design of the module (or maybe there's an existing module
that does what you want).


David Wortham
Senior Web Applications Developer
Unspam Technologies, Inc.
1901 Prospector Dr. #30
Park City, UT 84060
(435) 513-0672

On 3/23/07, Danie Qian <> wrote:

> Hi Dave,
> I think you are right after piecing together all the information I
> gathered
> from various places. As soon as a child process modify the data in the
> server config created by the parent server, the child gets a copy of it.
> This is ok if the server config is only a few httpd.conf directives but in
> my case it would be very inefficient as the table to be put in server
> config
> can grow to a few hundred Kilobytes. At this point child processes arent
> required to dynamically change anything in the server config but I dont
> feel
> comfortable to put in it being aware of the above fact.
> Someone in the forum mentioned about mutex for this situaction. Now i have
> one question: mutex is a multithread thing but if I run apache in
> single-thread mode like prefork is it still the best solution?
> Thanks,
> Daniel

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message