You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Frank Wiles <fr...@wiles.org> on 2000/07/06 21:03:00 UTC

Re: Apache/mod_perl

 .------[ Pramod Sokke wrote (2000/07/06 at 12:03:02) ]------
 | 
 |  We are running Netscape Enterprise server with cgis written in perl and C.
 |  I'm looking at moving over to Apache and start using mod_perl. How
 |  simple/complex do you think the process is going to be?
 |  There are tons of scripts distributed all over the place here. Would moving
 |  over to Apache/mod_perl going to be a simple plug-in or would it involve
 |  re-writing lots of stuff?
 |  
 `-------------------------------------------------

    From what I've gathered moving normal Perl CGIs is no problem what
    so ever.  The C CGIs can continue to run as normal, however without
    the performance benefits that mod_perl offers. 

    You'll probably want to rewrite any heavily utilized scripts, or
    ones that take large amounts of resources to run to take full
    advantage of mod_perl.  What I would suggest is setting up a small
    free Unix box ( Linux, FreeBSD, or whatever ) and moving the site
    over in a development/testing enviroment that way you can see what
    you are going to be up against for sure, in a relatively easy way. 

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


Re: Apache/mod_perl

Posted by Perrin Harkins <pe...@primenet.com>.
On Thu, 6 Jul 2000, Richard Dice wrote:

> > >(Another aspect of how it's
> > >slower is that you won't be able to take advantage of Apache::DBI persistent
> > >database connections with Apache::PerlRun.)
> > 
> > I *think* this is incorrect. PerlRun modules can take advantage of other
> > precached module resources including Apache::DBI.
> 
> You may be right.  I've never actually played around with Apache::PerlRun
> myself, just heard descriptions of its use.  These description, or my
> memory, or both, could be wrong.
> 
> > I do not think this section talks about Apache::DBI not working. Just that
> > the script just does not get cached.
> 
> This would be an easy enough experiment to do, unless someone wants to
> speak out and be an Authoritative Source prior to someone actually
> running the experiment. :-)

I've used Apache::PerlRun with Apache::DBI.  It works fine.  The only
difference between Registry and PerlRun is that PerlRun deletes all
compiled code and globals from the package it puts your script into after
each request.  That means your script has to be compiled every time, but
things in other packages are still persistent, just as they are with
Registry.

- Perrin


Re: Apache/mod_perl

Posted by Richard Dice <rd...@pobox.com>.
> >(Another aspect of how it's
> >slower is that you won't be able to take advantage of Apache::DBI persistent
> >database connections with Apache::PerlRun.)
> 
> I *think* this is incorrect. PerlRun modules can take advantage of other
> precached module resources including Apache::DBI.

You may be right.  I've never actually played around with Apache::PerlRun
myself, just heard descriptions of its use.  These description, or my
memory, or both, could be wrong.

> I do not think this section talks about Apache::DBI not working. Just that
> the script just does not get cached.

This would be an easy enough experiment to do, unless someone wants to
speak out and be an Authoritative Source prior to someone actually
running the experiment. :-)

Cheers,
Richard

-- 
----------------------------------------------------------------------------
 Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
 ShadNet Creator * http://shadnet.shad.ca/ * rdice@shadnet.shad.ca
 Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
     "squeeze the world 'til it's small enough to join us heel to toe"
         - jesus jones

Re: Apache/mod_perl

Posted by Gunther Birznieks <gu...@extropia.com>.
At 03:24 PM 7/6/00 -0400, Richard Dice wrote:
>Frank Wiles wrote:
> >
> >  .------[ Pramod Sokke wrote (2000/07/06 at 12:03:02) ]------
> >  |
> >  |  We are running Netscape Enterprise server with cgis written in perl 
> and C.
> >  |  I'm looking at moving over to Apache and start using mod_perl. How
> >  |  simple/complex do you think the process is going to be?
> >  |  There are tons of scripts distributed all over the place here. 
> Would moving
> >  |  over to Apache/mod_perl going to be a simple plug-in or would it 
> involve
> >  |  re-writing lots of stuff?
> >  |
> >  `-------------------------------------------------
> >
> >     From what I've gathered moving normal Perl CGIs is no problem what
> >     so ever.  The C CGIs can continue to run as normal, however without
> >     the performance benefits that mod_perl offers.
> >
> >     You'll probably want to rewrite any heavily utilized scripts, or
> >     ones that take large amounts of resources to run to take full
> >     advantage of mod_perl.
>
>Pramod, for a little bit more guidance...
>
>Your "regular old CGI Perl scripts" are going to be ported to mod_perl
>most easily using one of 2 different Apache/mod_perl modules:
>
>   * Apache::Registry
>   * Apache::PerlRun
>
>To be _really_ simplistic about it, Apache::Registry is faster, but it
>is more picky about the quality of your Perl CGI programs, insofar as
>quality is a measure of ability to hold up in a persistent environment.
>
>Apache::PerlRun is slower, but your scripts are going to handle a better
>chance of working without modification.  (Another aspect of how it's
>slower is that you won't be able to take advantage of Apache::DBI persistent
>database connections with Apache::PerlRun.)

I *think* this is incorrect. PerlRun modules can take advantage of other 
precached module resources including Apache::DBI. The slowdown is that the 
script package itself is forcibly removed from memory so the script itself 
is not cached for each run. But object modules are cached fine and that 
includes resources internal to modules like that such as Apache::DBI.

>Here are some helpful links from Sta's mod_perl guide online:
>
>CGI to mod_perl Porting. mod_perl Coding guidelines.
>http://perl.apache.org/guide/porting.html
>
>Apache::PerlRun
>http://perl.apache.org/guide/porting.html#Apache_PerlRun_a_closer_look

I do not think this section talks about Apache::DBI not working. Just that 
the script just does not get cached.


>Cheers,
>Richard
>
>--
>----------------------------------------------------------------------------
>  Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
>  ShadNet Creator * http://shadnet.shad.ca/ * rdice@shadnet.shad.ca
>  Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
>      "squeeze the world 'til it's small enough to join us heel to toe"
>          - jesus jones

__________________________________________________
Gunther Birznieks (gunther.birznieks@extropia.com)
eXtropia - The Web Technology Company
http://www.extropia.com/


Re: Apache/mod_perl

Posted by Richard Dice <rd...@pobox.com>.
Frank Wiles wrote:
> 
>  .------[ Pramod Sokke wrote (2000/07/06 at 12:03:02) ]------
>  |
>  |  We are running Netscape Enterprise server with cgis written in perl and C.
>  |  I'm looking at moving over to Apache and start using mod_perl. How
>  |  simple/complex do you think the process is going to be?
>  |  There are tons of scripts distributed all over the place here. Would moving
>  |  over to Apache/mod_perl going to be a simple plug-in or would it involve
>  |  re-writing lots of stuff?
>  |
>  `-------------------------------------------------
> 
>     From what I've gathered moving normal Perl CGIs is no problem what
>     so ever.  The C CGIs can continue to run as normal, however without
>     the performance benefits that mod_perl offers.
> 
>     You'll probably want to rewrite any heavily utilized scripts, or
>     ones that take large amounts of resources to run to take full
>     advantage of mod_perl.

Pramod, for a little bit more guidance...

Your "regular old CGI Perl scripts" are going to be ported to mod_perl
most easily using one of 2 different Apache/mod_perl modules:

  * Apache::Registry
  * Apache::PerlRun

To be _really_ simplistic about it, Apache::Registry is faster, but it
is more picky about the quality of your Perl CGI programs, insofar as
quality is a measure of ability to hold up in a persistent environment.

Apache::PerlRun is slower, but your scripts are going to handle a better
chance of working without modification.  (Another aspect of how it's
slower is that you won't be able to take advantage of Apache::DBI persistent
database connections with Apache::PerlRun.)

Here are some helpful links from Sta's mod_perl guide online:

CGI to mod_perl Porting. mod_perl Coding guidelines.
http://perl.apache.org/guide/porting.html

Apache::PerlRun
http://perl.apache.org/guide/porting.html#Apache_PerlRun_a_closer_look

Cheers,
Richard

-- 
----------------------------------------------------------------------------
 Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
 ShadNet Creator * http://shadnet.shad.ca/ * rdice@shadnet.shad.ca
 Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
     "squeeze the world 'til it's small enough to join us heel to toe"
         - jesus jones