httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harold J. Ship" <Har...@giant-steps-networks.com>
Subject RE: porting from IIS
Date Thu, 24 Jul 2008 12:56:07 GMT
Nick: Thank you for your reply, but I still don't quite get it.

>> module on Linux.

> An apache module is normally cross-platform.

Yes I know, and we will try to make ours cross platform but I believe
there are some differences between Windows and Linux versions with
respect to threading.

>> 1) They maintain their own thread pool and scheduler. Those threads 
>> process requests and send responses back to the user agent. This
frees 
>> up IIS threads. Is this possible to do in Apache? By the way, they
use 
>> Extension Control Blocks to do that.

> Yes, if you're happy to limit it to threaded implementations.
> But it may not make sense.  See apr_thread_proc (and related APR
modules) for API.

We are trying to minimize the changes to the client's application code,
and so we will have to do it with threads.

How it works today: there are 3 types of request: light, medium and
heavy.
We will need 2 "pools" of threads. One for handling light requests, and
one for medium/heavy.
The light requests can be dealt with by the usual mechanism.
The medium and heavy requests should be passed by the to the other
thread pool, freeing the original "ordinary" thread to handle more
incoming requests.

We are worried that if we try to process the medium and heavy requests
with a thread pool, then either the "ordinary" thread will block anyway,
or the next filter will get starved.

Note: these request types can be identified by their URL.

>> 2) Some requests have "sub-requests" that are sent back through IIS.
>> The main request maintains some globally accessible data that the 
>> sub-requests write to. When the sub-requests are completed, the main 
>> request can use that data. Is this kind of thing possible in an
Apache 
>> module?

> Yep, no problem.  Most likely you'll want to let the subrequest access
its parent.

The heavy requests mentioned above are to be sent to another server. The
other server will send back http requests to apache which will need
access to the original request object. The worker MPM is usually run in
several processes. We will probably force it to run in a single process
and create a global memory pool.

We spent some time trying to get shared memory working and kept getting
the error: "Permission denied" from apr_global_mutext_lock.

--
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

Mime
View raw message