You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Oleg Burlaca <ob...@neonet.md> on 2008/07/25 22:24:47 UTC

Which version of Apache: 2.2.x or 2.0.x ?

I've been using mod_perl1 for a couple of years without problems.
I've switched to mod_perl 2 half an year ago and always have problems 
(segfaults under prefork and sometimes troubles with mpm worker).
I hope that I did something wrong at compilation stage or it was 
something with the system (but I had problems with a couple of servers), 
nevermind..

Now I want a stable production environment with mp2 and want to know 
which httpd is suited for this 2.2.x or 2.0.x ?
Thanks.

Re: Which version of Apache: 2.2.x or 2.0.x ?

Posted by Oleg Burlaca <ob...@neonet.md>.
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.



Re: Which version of Apache: 2.2.x or 2.0.x ?

Posted by Michael Peters <mp...@plusthree.com>.
Oleg Burlaca wrote:

> and one more question: I have read that on linux platforms it's better 
> to use prefork instead of mpm-worker, I remember that we did some 
> performance test ourselves and it sounds to be true.

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.

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.

-- 
Michael Peters
Plus Three, LP


Re: Which version of Apache: 2.2.x or 2.0.x ?

Posted by Oleg Burlaca <ob...@neonet.md>.
Thanks André
> If this may reassure you, I have been using quite a bit of mod_perl 2 
> in the last 2-3 years with Apache 2.0.x and lately 2.2.x, under 
> Solaris, HPUX, Linux and Windows, and have not had the kind of 
> problems you mention.  So yes, it looks like you may have some 
> mismatched stuff there.
Hmm, I've always used two apaches with mod_proxy. The main errors I got 
reported by the front-end apache were "proxy: error reading status line 
from remote server". But these errors are not consistent, I got them 
from time to time. I'm using libapreq2.08, mod_perl2.0.3 with httpd 
2.0.63. (perl5.8.3).
> As for versions, I would tend to recommend the latest version of 
> Apache 2.2.x you can find, and then look for the latest versions of 
> perl 5.8.x and mod_perl 2.x that fit together.
I've just got another VPS server with perl5.8.8 on it. I'll install 
httpd  2.2.9 and mod_perl 2.0.4 and test a little.
Should I get libapreq from svn or the latest stable version 2.08 is ok?

and one more question: I have read that on linux platforms it's better 
to use prefork instead of mpm-worker, I remember that we did some 
performance test ourselves and it sounds to be true.

Regards.

Re: Which version of Apache: 2.2.x or 2.0.x ?

Posted by André Warnier <aw...@ice-sa.com>.
Oleg Burlaca wrote:
[...]
If this may reassure you, I have been using quite a bit of mod_perl 2 in 
the last 2-3 years with Apache 2.0.x and lately 2.2.x, under Solaris, 
HPUX, Linux and Windows, and have not had the kind of problems you 
mention.  So yes, it looks like you may have some mismatched stuff there.
As for versions, I would tend to recommend the latest version of Apache 
2.2.x you can find, and then look for the latest versions of perl 5.8.x 
and mod_perl 2.x that fit together.
I have always followed the instructions at
http://perl.apache.org/docs/2.0/user/install/install.html
and never had any major problem that I recall.

On some platforms (like HPUX), it may be better to get a complete 
package from the manufacturer, where everything you need is already 
included.

The next time, it may be helpful if you indicate which platform, OS 
etc.. you are interested in, the might be other people with more precise 
tips for one or the other.

André