On Thu, 06 Jul 2000, Pramod Sokke wrote:
> >1) I installed apache with mod_perl - the speed increased.But I didn't
> >understand HOW mod_perl optimizes use of resources and increases speed ?
> >Does it share perl interpreter, script or anything else?
> 
> The Perl runtime library is linked into the server. The persistent
> interpreter embedded in the server avoids the overhead of starting an
> external interpreter program and the additional Perl start-up time. That's
> the main cause of increase in speed.
> 
mod_perl also caches compiled perl code so you gain time there as well. I.E.
CGI - load perl + open perl script + compile script + execute.
mod_perl - execute cached script

We have gained considerable performance (10x) because we use so many shared
libraries. These libraries get cached in the server under mod_perl and no
longer need to be reloaded and recompiled for every hit.

> >2) Then I installed FastCGI - but I didn't see the differance. Speed and
> >memory usage remained the same. 
> >
FastCGI with perl may or may not be that fast. I could be totally wrong here
but I believe that FastCGI will be able to cache the perl runtime, but perl
will still have to reload and recompile any scripts during every hit.



> >I test with mysql database (16000 records, 5 fields of different types)
> >- 
> >SELECT * FROM TEST WHERE one < $a and one > $b;
> >Next, I open, read and parse 5Mb text file.
> >With LWP::Parallel::UserAgent perl module I send 10 parallel requests.
> >
> >Do mod_perl and FastCGI installed in the same Apache server interact and
> >how do they interact if they do at all?
There should be no interaction as long as you have set up your httpd.conf file
with the basic setup - some alias dir or file extention is always mod_perl and
some other is always FastCGI.

You might also look into Apache::DBI for database connectivity. It will allow
you to very easily use persistent connections => one db connect per
apache thread, instead of one per page hit.


Dana

Reply via email to