Philippe de Rochambeeau asked:
> is there any way to send several HTTP requests simultaneously
> (e.g. a few database queries, a few CGI queries) on a
> network, wait for all the responses, collate them, and
> display the collated results on a web page, in a Perl CGI? If
> so, can you point me to some example code? Do I need a
> technology such as SOAP, XML-RPC or CORBA to do that?
Your question is a little befuddled, as it sounds that you are, so I will
try to clear up any ambiguities for you...
First of all, the answer is yes. It is possible to write/reuse a Perl
script to do load testing, which it seems that you are trying to do.
(Assumption #1)
Secondly, if you are trying to do this in a CGI, it's going to be a lot more
complex than simply running a script that would dump a text file as output.
You will not need SOAP, XML-RPC, or CORBA.
SOAP is a protocol that applications use to talk to other applications on
the web. It is not intended for human-parsable output. The idea is simply
that an application makes a call to the internet & gets a response in XML
format.
CORBA is a means by which you manage distributed objects. You wouldn't need
to manage your resources in this way unless you were correlating the input
from several systems running load testing simultaneously. Even then , I
personally have never used CORBA with Perl, only with Java.
XML is a data format & seems superfluous unless you're looking to export the
data for analysis later & I regret that I'm not familiar with the RPC
element that you mentioned in that context.
If you are indeed doing load testing, there are several off the shelf
packages designed specifically for Q/A, which also include such wonderful
features as regression testing & stress testing. QA Suite from Rational
does this for example, but only runs under Windows(ack!) plus it's very
expensive. URLhammer is a Java application that is included in the ATG
Dynamo distribution. I use that quite often also.
Note the subtle distinction between load testing & stress testing. Load
testing is a test to see how well the system performs under a load & when &
how much of a slowdown do you get. Stress testing is more extreme. It's a
question of seeing how much load your system can take before it BREAKS.
Another note here is that if you are looking to record response times, it is
easier to measure time in <1 second intervals in Java than it is in Perl.
I've been turned on recently to Time::HiRes on CPAN, which should clear this
up.
HTH!
- Gregor42
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 10, 2001 4:09 AM
> To: [EMAIL PROTECTED]
> Subject: Sending several requests simultaneously and collating the
> results on one web page
>
>
> Hello,
>
> is there any way to send several HTTP requests simultaneously
> (e.g. a few database queries, a few cgi queries) on a
> network, wait for all the responses, collate them, and
> display the collated results on a web page, in a Perl CGI? If
> so, can you point me to some example code? Do I need a
> technology such as SOAP, XML-RPC or Corba to do that?
>
> I was thinking of using multi-threaded Java applets for this,
> but wondered if there were a way in Perl to do this.
>
> Many thanks.
>
> Philippe de Rochambeeau
>