"C. Jon Larsen" wrote:
> 
> One of the main reasons I use mod_perl is because of the pre-fork caching
> I can do in the parent that the children can share cheaply. I take huge
> data structures and assemble them in ram as read-only databases (read
> hash tables) that are much faster and simpler to access than sql (I use
> sql only where my data is read/write).
> 
> With all this talk about threaded perl interpreters what I'd like to be
> sure of is that in Apache 2.0 my model does not break. Can each private
> perl interpreter keep its cached (shared) data structures in memory ?
> 
> Most of my mod_perl processes are big - 10-12 MB, but easily 90+ percent
> of that is shared. I like this setup, and want to be sure that apache 2.0
> does not break this in any way. threads ? are they really appropriate for
> everyone ? can the old behavior be maintained ? If not, then we would seem
> to be moving to a more php-like environment, which would be a major bust
> for me. I can triple (sometimes more) the performance of my handlers by
> packing my data that is read-only into memory, and using sql only as
> needed !
> 
> Any comments ? Am I off base ? Worrying without cause ?

No, you certainly aren't off base.  These are precisely the issues that
need to be worked out.

Apache 2.0 doesn't have a fixed process model.  It has a modular
multi-process model, or MPM.  All of the MPMs so far have n processes
and p threads per process.  You could have a purely threading Apache
(n=1, p=1..*), or a classic Apache (n=1..*, p=1), or something in
between.  Threads could be kernel threads, pthreads, userland threads,
lightweight processes, or something else.  Obviously when you are
deploying Apache, you need to pick one of the MPMs.  Doug indicated
earlier that he wanted to make mod_perl work with all MPMs, so any work
we do is going to need to be general.

If your work relies on pre-fork caching of data, then you will be able
to use Apache 2.0 with a pre-fork MPM.  Of course, you could also stick
with Apache 1.3.x indefinitely.  It is, after all, a fine product.

You mention that your data structures are read-only.  I don't think you
are going to have any problems with the thread model, because read-only
data is inherently thread safe.  The problems don't happen until you are
trying to do mixed reading and writing with the same data structure by
multiple threads.

Hope that answers some questions,
Jeffrey

Reply via email to