Michael Peters wrote:
prefork will use a different process for each Apache child and thus a different Perl interpreter for each process. Normally this would mean a lot of memory usage, but since Linux uses COW (copy-on-write) memory as long as you preload you'll actually see about the same memory usage as with worker/threads.
By "preload" you mean loading all perl modules I'm using in scripts? Yes, I do preload all the modules at startup.
And if you have a multi-core or multi-processor system, having sepeparate processes that know nothing about each other should result in less contention (they aren't sharing internal Perl structures). Plus you don't have to worry about trying to make sure every module you use from CPAN is thread-safe.
Aahhh, thanks for this hint: "thread-safe modules". Now I'm sure I'll use prefork.
Thanks Michael.

P.S. not mod_perl related but .. For a few weeks I thought about switching to Ruby, Ruby on Rails after 5 years of mod_perl... but still decided to use mod_perl in the future, that's why I'm very cautious about mod_perl and want to be sure it will run smoothly.


Reply via email to