Re: Apache : mod_perl vs fastcgi

2000-07-07 Thread David Hodgkinson


Dana Powers [EMAIL PROTECTED] writes:

 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.

Not true.

You put some code in your CGI to "get next CGI request". Your fully
compiled program does this for as many times as it needs to.

See the paper linked off my homepage *plug* *plug* ;-)

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Re: Apache : mod_perl vs fastcgi

2000-07-07 Thread Gunther Birznieks

In addition, you can read the CGI.pm documentation on the use of 
Perl/CGI.pm with FastCGI and you'll be good to go with that get next 
request technique.

At 08:14 AM 7/7/00 +0100, David Hodgkinson wrote:

Dana Powers [EMAIL PROTECTED] writes:

  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.

Not true.

You put some code in your CGI to "get next CGI request". Your fully
compiled program does this for as many times as it needs to.

See the paper linked off my homepage *plug* *plug* ;-)

--
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
   Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
   -




Apache : mod_perl vs fastcgi

2000-07-06 Thread Yury XTC

Hi!

Instaled : FreeBSD 4.0 + Apache 1.3.12 + mod_perl 1.24 + FastCGI 0.52

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?
2) Then I installed FastCGI - but I didn't see the differance. Speed and
memory usage remained the same. 

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?

Was Lighte!
Yury XTC[EMAIL PROTECTED]





Re: Apache : mod_perl vs fastcgi

2000-07-06 Thread Pramod Sokke

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.

2) Then I installed FastCGI - but I didn't see the differance. Speed and
memory usage remained the same. 

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?

Was Lighte!
Yury XTC[EMAIL PROTECTED]
 



Re: Apache : mod_perl vs fastcgi

2000-07-06 Thread Dana Powers

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