|
From: <an...@io...> - 2005-07-05 20:30:19
|
Perrin Harkins wrote:
> I don't know anyone who compiles mod_perl as DSO. There are clear
> warnings not to do that.
Oh that is probably true. I just checked and the Debian (in fact sadly
Ubuntu at the moment) apache-perl package has Perl statically compiled
instead of a DSO - and it _still_ did all of the initializations twice
with OI2. You can verify if this applies to you by looking at the OI2
log. The memory consuming loop in shutdown is also happening on the same
server if OI2 has served at least one request.
> What does this mean? That it picks up module changes? Apache::Reload
> does that too.
I'm not sure if Apache::Reload works with OI2 very well since at least
the Actions are cached & cloned by OI2. Also OI2 uses lots of
configuration files which determine behaviour and autogenerate modules,
which are naturally not reloaded by Apache::Reload. Anyway this is just
speculation but I think I'm not far from the truth..
> You can easily tell apache how many processes it should run on your
> development server. A FastCGI server intended for production will
> certainly run more than one process.
Well by development I did mean really just development, not production.
We run OI2 with mod_perl on our production servers and continue to do so
also in the future, but the beauty of OI2 is that it really doesn't
matter which one of the options you use for development. At least for me
FastCGI seems to speed up the development process quite a lot.. Or at
least it feels like that ;)
Anyway this is not really an issue when developing since you barely even
notice it (even though I have noticed almost doubled execution times on
the first request of a child, but this might be affected by many other
things also) - the other ones weight a lot more when choosing the
platform for development.
But to clarify the situation I'm talking about: It doesn't matter how
many child processes you use with Apache, they all are forked from the
main process and share almost all of their static memory with the parent
process until the memory becomes dirty and has to be copied to the
child's own pool. So even if you would run only one child process, you
would still have to copy lots of memory on the first request. Memory
copying itself is not such an expensive task, but with large codebases
and long execution paths like with OI2, the copying is done quite many
separate times.
By the way if somebody wants to inspect the OI2 execution trail and how
long each of the stages take, you can change conf/log4perl.conf to use
DEBUG for log4perl.logger.OI2 and add SSS to the ConversionPattern in
the end ( to %d{HH:mm:ss:SSS} ) to see millisecond timestamps on all log
entries. All of the logging adds something like 20% to the execution
time but you get a nice picture of how the execution is laid out in
terms of time.
- Antti
|