You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Joshua Marantz <jm...@google.com> on 2011/09/12 14:12:35 UTC

Re: Apache worker

+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 <ma...@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
>