httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Poirier" <poir...@pobox.com>
Subject Re: After-request hooks or asychronous modules
Date Sun, 28 Feb 2010 12:42:48 GMT
On Sun, 28 Feb 2010 11:27 +0100, "Samuel ROZE" <samuel.roze@gmail.com>
wrote:
> Yes, the log_transaction hook is what I expect, thanks! :-)
>
> But I've still a problem: if in my hook function I put a sleep
> function, which sleep for 10 seconds for example, the first page is
> served correctly (few ms) but for the next, it will wait for these 10s
> (not really 10s but the rest time), is it because I should have
> threads?

That's probably due to keep-alive.  With keep-alive on, the same
connection is used for subsequent requests from the same client, which
means the same thread has to receive and process the request.

But I'm not recommending turning off keep-alive as a fix.  Creating
worker threads is one solution.  Just keep in mind that many APR
functions, like pool management, are not thread-safe, so you'll need to
carefully protect their use with mutexes or the equivalent.

Dan

Mime
View raw message