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

Hey folks,
   I need to build a simulator to test the integrity and load capabilities of some CGIs.

Question 1- Can I build build a Perl script to communicate, preferably over a network, with my CGIs. (i.e. emulate a web user sending GET and POST URLs)
I only need to be able to talk with the CGI to initiate different functions.
I do not need to know how the CGI responds because my CGI logs all of it's acivities.

Question 2- Could someone give me some pointers on how to do this.

Question 3- Could someone tell me what modules, if any, I will need.

Any other information would be helpfull.

Thanks in advance.

-tharant

  • Comment on Perl newbie seeks help w/ CGI communication

Replies are listed 'Best First'.
Re: Perl newbie seeks help w/ CGI communication
by agoth (Chaplain) on Oct 10, 2000 at 13:52 UTC
    1, 2 and 3:

    LWP::UserAgent or LWP::Simple from CPAN will enable you to remotely kick off your CGI's, and also get the resulting pages.

Re: Perl newbie seeks help w/ CGI communication
by AgentM (Curate) on Oct 11, 2000 at 00:06 UTC
    If you want real results that you can show to your boss (God forbid), you should fire up multiple instances of your CGI (perhaps with FastCGI. yes i realize i link to this site alot nowadays!). Then bombard your test server with CGI POSTs to the script. If you're expecting heavy usage of your CGI script, then you should really be using mod_perl or FastCGI, anyway. You should test more than one process when you're testing a program since other factors can compromise your results. Testing the program at maximum load could possibly reveal a weak spot or breaking point, especially if their are databases, file ~locking, or IPC invloved. The best way to test, is to put it under heavy fire. You could use Benchmark to test specific regions or algorithms in your code for possible improvement. Give it a whorl and post what you get in the Code section. Have a nice day!
    AgentM Systems or Nasca Enterprises is not responsible for the comments made by AgentM- anywhere.