magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1998 > 08 > Programming with Perl  

Stress-Testing CGI in Parallel

Last month's column showed my first use of the LWP::Parallel::UserAgent -- a way of sending out multiple requests in the same process to be satisfied concurrently. This time, let's look at another use of the same package to stress-test a CGI script. If you haven't installed the Parallel User Agent, you'll find it in the CPAN. (The CPAN can be found at cpan.perl.org, among other places.) You'll also need to install the LWP package, also found in the CPAN.

As a practical test target, I decided to beat up on my Eliza bot script from a few columns ago (see "Programming with Perl," Web Techniques, April 1998). In fact, this was a good practical test to ensure that multiple users would have the right information, and that the program would work correctly no matter how fast the requests came in. I was hitting between 2 and 4 requests per second with this test harness on a moderate-speed SPARCstation, much faster than I could hit the submit button on my browser.

Request for Success

The program that repeatedly connects to the Eliza script is presented in Listing One.

Line 1 begins most of the Perl programs I write, giving the path to my Perl (bin) directory and turning on warnings.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2