jason0 has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I would like to modify a perl cgi application that makes system() calls to rcs run under mod_perl. I will start with using Apache::PerlRun, but eventually want to see it all run under Apache::Registry.

Is it reasonable to assume that the Rcs CPAN module will function as I expect it to under mod_perl in either Apache::PerlRun, or Apache::Registry mode?

Thanks very much for your consideration...

--jason

Replies are listed 'Best First'.
Re: Rcs and mod_perl
by sgifford (Prior) on Apr 03, 2004 at 09:02 UTC

    If the Rcs module is creating new processes with fork, such as by calling system to run the command-line RCS commands, you may want to read the mod_perl Performance Tuning section on forking and executing subprocesses. You may find that your script starts up faster with mod_perl, but takes longer to fork because it's running with all of Apache in its memory space; you'll have to benchmark to see for sure.

    Regardless of whether the module is creating new processes, you'll have to test it a bit to make sure it works OK. Sometimes calling subs from the same module over and over again from within the same long-running process will bring out previously undiscovered bugs, in particular with data that should be reset for each invocation but isn't. These bugs are usually fairly easy to fix, but you have to watch out for them.

    Good luck!

Re: Rcs and mod_perl
by Vautrin (Hermit) on Apr 03, 2004 at 04:17 UTC

    Since no one else has responded, I will take a crack at it. Please correct me if I'm wrong. mod_perl caches the compilation of the Perl script. Thus, if the perl script runs once it will run faster the next time, because Perl doesn't need to compile it. This makes it comparably fast to C. What modules you are using should be irrelevant, as should how many system() calls you make, because all mod_perl is doing is caching the compilation.


    Want to support the EFF and FSF by buying cool stuff? Click here.