----- Original Message -----
From: "David Wortham" <[EMAIL PROTECTED]>
To: <[email protected]>; "Danie Qian" <[EMAIL PROTECTED]>
Sent: Friday, March 23, 2007 2:39 PM
Subject: Re: load data at server startup - is ap_hook_post_config() the
right place?
Daniel,
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).
Hi Dave,
To be more meaningful about what I am talking about, here is our setup: We
have around 5 thousand sites running on a few web-farmed locations. Each
location has about 10~20 linux apache servers running behind a load
balancer. Every apache usually has 40~50 child processes running to serve
the amount traffic. Internally every site is maintained as one of our
products with all its operation information stored in mysql databases. With
the information from one of the tables we can decide where the site folder
is by looking at the site name and some other fields associated with the
site. What I am thinking to do with the module is to load all the relevant
fields into apache memory space upon apache startup and let every request
look up from that chunk of memory for better performance. so as u can see we
are nailed a setup of multiple processes and probably single thread mode in
apache.
Thanks,
Daniel