httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Marantz <jmara...@google.com>
Subject Re: Apache worker
Date Mon, 12 Sep 2011 12:12:35 GMT
+modules-dev : someone with a voice of authority should chime in if I (when)
say something controversial :)

I've not seen any doc on worker MPM vs prefork & event.  I would love to see
that.

My observations with Worker MPM is that you will get multiple concurrent
requests on the same server_rec, so all access to data you hang off the
server_rec should be properly mutex-protected.  That was enough -- we
believe -- to make our module robust and functional in worker MPM.

load-testing is essential, and helped us reproduce & prove fixed the two
issues we found where we weren't mutexing enough in our module.  Also see
http://valgrind.org/docs/manual/hg-manual.html.

As mentioned in an earlier thread, what was not helpful was the apr "pool
debug" infrastructure, which appears to have insufficient mutexing for its
internal debug structures to run correctly in the Worker MPM.

I would also love to hear anecdotal evidence of superior performance -- by
some metric -- obtained using the Worker MPM.  In my own load-test I got
higher QPS using prefork, but we haven't tuned our module, which has its own
multi-threading architecture independent of MPM, for Worker yet so we
probably didn't allocate the optimal number of threads.

-Josh

On Mon, Sep 12, 2011 at 4:59 AM, Massimo Manghi <massimo.manghi@unipr.it>wrote:

> Hi Josh
>
> I read your messages on the modules-dev list about the problems you had
> with the worker MPM. Even though you had to deal with some problems with
> the apr pools it seems you were able to get your module working with a
> threaded server.
>
> I'm the maintainer/developer of Apache Rivet, an Apache module with some
> extra software for scripting pages using the Tcl language. Our
> module is working with the prefork mpm, but someone put forward that we
> should also support 'worker' so I got to work on this.
>
> I've been struggling with the worker mpm for a while and had to set it
> aside because of lack of adequate documentation. What I understand after
> some debugging is that, from the perspective of a server thread, threads
> don't simply take the role of prefork processes, there are more implications
> apart the usual caveats of threaded programming and perhaps there are hooks
> and specific calls to Apache to deal with threads. Did you take inspiration
> from some specific threaded module to design your threading support? Did you
> have some specific reference for this?
>
> sorry for the long message.
>
> thanks in advance for any suggestion
>
>  -- Massimo Manghi
>
> P.S. I wrote on the list a similar help request weeks ago, but it went
> totally unanswered
>

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