You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Adriano Ferreira <a....@gmail.com> on 2006/08/29 20:20:02 UTC

getting to know more about mod_perl

Hi, mod_perl people.

I am preparing a presentation about technologies which make Perl more
visible. In this vein, I would like to say a few words about mod_perl.
But I am short of knowledge on this subject and need to understand
some things about it, to sound convivincing. Then I dare to bother
the list with some questions. I will be very grateful by your answers,
even if they are "Dull question. Read this and read that, add two and
two, make four and bug me not."

Q: how does mod_perl compares to PHP? Both are interpreters inside the
Apache web server, ain't it? I am interested in all shades of
distinction and similarity here: performance, cost, safety, marketing,
etc.

Thanks a lot for any help.

Best regards,
Adriano Ferreira

Re: getting to know more about mod_perl

Posted by Boysenberry Payne <bo...@humaniteque.com>.
I started as a PHP/Javascript guy, then moved to Perl.
Perl has proven to be way more flexible a language to
program in, a pro to me, a con to some.

Besides its support for myriad programming styles, CPAN
offers hundreds, if not thousands of open source modules
to use with perl.  This is good for rapid development as well
as rapid learning of the syntax.  I could find that in the PHP
communities.

As far as mod_perl with apache goes, there are others on
this list who can answer the details of a comparison better
than I.  What I will say is mod_perl has proven to be more
scalable and much faster on my production servers.

Basically, I let our users have php for their script, but stick
to mod_perl for mine.

I think its easier to really bring down a whole server with
mod_perl than it is with php.  Both can be dangerous in
the wrong hands, but PHP seems easier for novice programmers
and for small quick self contained projects.  I don't know
of anything else as well behaved and robust as mod_perl
for the serious programmer; I prefer it to Java any day...

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Aug 29, 2006, at 1:20 PM, Adriano Ferreira wrote:

> Hi, mod_perl people.
>
> I am preparing a presentation about technologies which make Perl more
> visible. In this vein, I would like to say a few words about mod_perl.
> But I am short of knowledge on this subject and need to understand
> some things about it, to sound convivincing. Then I dare to bother
> the list with some questions. I will be very grateful by your answers,
> even if they are "Dull question. Read this and read that, add two and
> two, make four and bug me not."
>
> Q: how does mod_perl compares to PHP? Both are interpreters inside the
> Apache web server, ain't it? I am interested in all shades of
> distinction and similarity here: performance, cost, safety, marketing,
> etc.
>
> Thanks a lot for any help.
>
> Best regards,
> Adriano Ferreira
>
>


Re: getting to know more about mod_perl

Posted by Perrin Harkins <pe...@elem.com>.
On Tue, 2006-08-29 at 15:20 -0300, Adriano Ferreira wrote:
> Q: how does mod_perl compares to PHP?

Since this comes up frequently, many people have tried to answer it.
You can see some threads if you search perlmonks.org for PHP.  Here are
some to get you started:
http://perlmonks.org/?node_id=382763
http://perlmonks.org/?node_id=459203
http://perlmonks.org/?node_id=508637
http://perlmonks.org/?node_id=554630
http://perlmonks.org/?node_id=564901

Be warned, these get quite histrionic at times.

- Perrin


Re: getting to know more about mod_perl

Posted by Jonathan Vanasco <mo...@2xlp.com>.
On Aug 29, 2006, at 3:08 PM, Adriano Ferreira wrote:

> I meant cost with respect to the machine resources: mainly, memory and
> processor time. Thanks a lot for the various references that I am
> going to absorb.

mod_perl consumes more memory than php- php compiles into a smaller  
footprint, but it is a bit faster.

mod_perl caches the compiled perl code into memory.  php requires a  
third party cache to do that ( eaccelerator or one of the other  
opcode optimizers that also do memory caching ).

mod_perl requires apache- its about extending /configuring apache  
with perl, and interfacing with the entire server and request  
cycle.    in essence, mod_perl gives you a fully scriptable web server.

php is just a content-generating scripting language.  you can run it  
via mod_php or fastcgi, or even with a non-apache  server (lighttpd,  
nginx, thtppd ).  it doesn't hook into any server like mod-perl.

the drawback to that, is that you're locked into Apache if you use   
mod_perl... and you have more server options if you use PHP.  That's  
only for the dynamic content though- with a smart reverse proxy or  
load balancer, you can specify which servers serve what.

> About security (as an example), I remember to have read somewhere that
> Apache::DBI can be dangerous because of the sharing of the DB
> connections and the openness of Perl - a malevolent user could try
> (and succeed) to access connections of other applications as they are
> running in the same interpreter. But, there are no such issues in PHP
> as well?

possibly, but its a moot point.  (btw, it would generally be  
applications running in the same apache child, as db connections are  
best made post-fork )
	because of design of mod_perl (ie intensive memory use ) people do  
not normally run mod_perl on a shared server.   mp usually sits on  
its own box, and is tweaked for speed / performance -- getting the  
most out of your server.
	php is also geared towards multi-user setups (ie: shared hosting).

if you want to talk about security though, php has a long history of  
bad security exploits.  they've gotten a lot better, but for a few  
years, you'd have to upgrade php every other  week.

in practice , i've seen that people make 'applications' on mod_perl-  
large systems that serve a single purpose - and 'projects' in php.   
i'm not saying that you can't make a large site in php or a small  
site in mod_perl... i'm just saying that its best to choose the right  
tool for the job.  everyone i know who does anything semi-large in  
php, goes crazy tweaking 3rd party optimizers and accelerators

in terms of programmers, there's a plethora of awful-novice php  
programmers out there, that will work for next to nothing.  probably  
100x more than mod_perl programmers.

but you get what you pay for.

a  well versed php or mod_perl expert are both going to demand  
similar wages, and be 100% worth their cost.

look at what you want to build now, and where you want it to go  
tomorrow-- and choose the right tool for that job.  it might be  
mod_perl, it might be php, it might be something else.  but  
popularity and marketing are hands down the  two WORST factors to go  
by though.


Re: getting to know more about mod_perl

Posted by Adriano Ferreira <a....@gmail.com>.
On 8/29/06, Frank Wiles <fr...@wiles.org> wrote:
> On Tue, 29 Aug 2006 20:27:02 +0200
>    Based on what I've read recently performance is comparable. They
>    are both free so I'm not sure what you mean by cost.

I meant cost with respect to the machine resources: mainly, memory and
processor time. Thanks a lot for the various references that I am
going to absorb.

>    Personally, I avoid many applications written in PHP due to their
>    past security histories.  I know this is a broad generalization, but
>    I do tend to look over a PHP application much more closely than
>    applications written in other languages.  It isn't so much the
>    language itself, but the programmers PHP tends to attract I
>    would wager.

About security (as an example), I remember to have read somewhere that
Apache::DBI can be dangerous because of the sharing of the DB
connections and the openness of Perl - a malevolent user could try
(and succeed) to access connections of other applications as they are
running in the same interpreter. But, there are no such issues in PHP
as well?

>    Apart from being entirely different languages, the biggest difference
>    is that PHP is only useful in the response phase of the Apache cycle,
>    where mod_perl can be used to actually configure and completely
>    control the Apache webserver from Perl.

Alright. That's one main distinction for me to remember: it sums up
points to Perl (at least to those who can take advantage of that).

Regards,
Adriano.

Re: getting to know more about mod_perl

Posted by Frank Wiles <fr...@wiles.org>.
On Tue, 29 Aug 2006 20:27:02 +0200
Clinton Gormley <cl...@traveljury.com> wrote:

> On Tue, 2006-08-29 at 15:20 -0300, Adriano Ferreira wrote:
> > Hi, mod_perl people.
> > 
> > I am preparing a presentation about technologies which make Perl
> > more visible. In this vein, I would like to say a few words about
> > mod_perl. But I am short of knowledge on this subject and need to
> > understand some things about it, to sound convivincing. Then I dare
> > to bother the list with some questions. I will be very grateful by
> > your answers, even if they are "Dull question. Read this and read
> > that, add two and two, make four and bug me not."
> > 
> > Q: how does mod_perl compares to PHP? Both are interpreters inside
> > the Apache web server, ain't it? I am interested in all shades of
> > distinction and similarity here: performance, cost, safety,
> > marketing, etc.
> > 
> 
> http://www.serverwatch.com/tutorials/article.php/1126681
> http://perlmonks.org/?node_id=18661

   Both of those articles are from 2000 and I'm sure a bunch of things
   have changed since then. :) 

   Based on what I've read recently performance is comparable. They
   are both free so I'm not sure what you mean by cost. 

   Personally, I avoid many applications written in PHP due to their
   past security histories.  I know this is a broad generalization, but
   I do tend to look over a PHP application much more closely than
   applications written in other languages.  It isn't so much the
   language itself, but the programmers PHP tends to attract I 
   would wager. 

   Apart from being entirely different languages, the biggest difference
   is that PHP is only useful in the response phase of the Apache cycle,
   where mod_perl can be used to actually configure and completely
   control the Apache webserver from Perl. 

   With the added ability of protocol handlers, you can even implement
   other non-HTTP protocols. 

 ---------------------------------
   Frank Wiles <fr...@wiles.org>
   http://www.wiles.org
 ---------------------------------


Re: getting to know more about mod_perl

Posted by Clinton Gormley <cl...@traveljury.com>.
On Tue, 2006-08-29 at 15:20 -0300, Adriano Ferreira wrote:
> Hi, mod_perl people.
> 
> I am preparing a presentation about technologies which make Perl more
> visible. In this vein, I would like to say a few words about mod_perl.
> But I am short of knowledge on this subject and need to understand
> some things about it, to sound convivincing. Then I dare to bother
> the list with some questions. I will be very grateful by your answers,
> even if they are "Dull question. Read this and read that, add two and
> two, make four and bug me not."
> 
> Q: how does mod_perl compares to PHP? Both are interpreters inside the
> Apache web server, ain't it? I am interested in all shades of
> distinction and similarity here: performance, cost, safety, marketing,
> etc.
> 

http://www.serverwatch.com/tutorials/article.php/1126681
http://perlmonks.org/?node_id=18661