Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to test speed difference of Perl/Apache and SSI/Apache

Reply
Thread Tools

How to test speed difference of Perl/Apache and SSI/Apache

 
 
The Poor
Guest
Posts: n/a
 
      09-27-2003
I am using SSI now and it can not include external things. I want to
use Perl/CGI to do that, but worried about slower speed. How do I
test/benchmark the different of loading on Perl/Apache and SSI/Apache.

in perl
open a file for read, print it, close file

in ssi
include the file

because the network speed vary much, how do i calculate the speed of
the perl vs ssi? i can easily open/read/print/close 100 times in perl,
but i can not do that in ssi to compare...

i know in perl open/write is not multithread. how about open/read. can
many perl instances open and read the same file? what is the max
number of perl programs open the same perl? what the list of
ssi?--same as the limit of apache?

In term of speed, what is the best choice? PHP/Apache,
Mod_Perl/Apache, Fast_cgi/Apache, standred Perl/Apache, C exe/Apache,
jsp/Apache?
 
Reply With Quote
 
 
 
 
Eric J. Roode
Guest
Posts: n/a
 
      09-27-2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

http://www.velocityreviews.com/forums/(E-Mail Removed).2y.net (The Poor) wrote in news:30bcc0c9.0309262039.64792513
@posting.google.com:

> In term of speed, what is the best choice? PHP/Apache,
> Mod_Perl/Apache, Fast_cgi/Apache, standred Perl/Apache, C exe/Apache,
> jsp/Apache?


I can't speak for PHP or JSP, having no experience with them.

C executable is probably the fastest of the other choices. Bitch to write,
though. And you do have the overhead of forking a new process.

Standard CGI is by far the slowest. By *FAR*.

FastCGI and mod_perl are much faster than standard perl CGI. They are
comparable in speed. The relative speeds vary based on how well the
programs are written, what functions they are actually performing, etc. I
believe that a well-written FastCGI program is a hair faster than a well-
written mod_perl program, all other things being equal -- but for most
intents and purposes, it's a toss-up.

I personally find FastCGI programs easier to write and debug than mod_perl
programs. And FastCGI scales better, but that's only an issue if you have
a humongous website that's serving hundreds of thousands of requests a day.

Faster still would be an Apache module written in C. Those are a royal
pain to write and debug, though.

- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBP3Ut7GPeouIeTNHoEQLxUQCg9WC+FfFWRckNLbU7SWAM55 GNzKsAoIwt
+WG834np3tSyKutPTo/0tLZ/
=MGtR
-----END PGP SIGNATURE-----
 
Reply With Quote
 
 
 
 
Gregory Toomey
Guest
Posts: n/a
 
      09-27-2003
It was a dark and stormy night, and The Poor managed to scribble:

> I am using SSI now and it can not include external things. I want to
> use Perl/CGI to do that, but worried about slower speed. How do I
> test/benchmark the different of loading on Perl/Apache and SSI/Apache.
>
> in perl
> open a file for read, print it, close file
>
> in ssi
> include the file
>
> because the network speed vary much, how do i calculate the speed of
> the perl vs ssi? i can easily open/read/print/close 100 times in perl,
> but i can not do that in ssi to compare...


But you can write two Perl script using LWP::Simple to retrieve the two different URLs using get(). One URL is for the Perl cgi, the otheris for SSI.
Its a easy matter to time each of the scripts.


For example, URL1.pl contains:
#!/usr/bin/perl
use strict;
use LWP::Simple;
get('http://mysite.com/Perltest.cgi');

URL2.pl contains:
#!/usr/bin/perl
use strict;
use LWP::Simple;
get('http://mysite.com/ssitest');


and in linux you just 'time URL1.pl' and 'time URL2.pl' will tell you how long it takes to retrieve each page.


gtoomey
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
difference between new Test(); and new Test; Anarki C++ 1 08-12-2007 10:22 AM
speed speed speed a.metselaar Computer Support 14 12-30-2003 03:34 AM
java tool to test disk i/o, processor speed, and network speed efiedler Java 1 10-09-2003 03:36 PM
test test test test test test test Computer Support 2 07-02-2003 06:02 PM



Advertisments