PERL processing

Bernie Aua (bernie@summum.org)
Tue, 12 Oct 1999 15:25:45 -0700


This does not necessarily have anything to do with LWP, but hopefully
someone on this list has some expertise on how PERL processing happens in a
system.

I've got a web server running a PERL cgi script that fetches a web document,
does some content massaging, then returns the invigorated contents. The
script works well (My compliments to Gisle Aas and everyone else who helped
develop LWP. It's a beautiful thing). However, I seem to have an issue.

I am under the impression that when a PERL cgi script is called (in this
case by a client request that comes in), an instance of the script is run.
Should there be multiple independent client requests, multiple instances of
the script will run which are all independent as well.

But in the situation where multiple client requests come in at the same time
or close to the same time, let's say within a second or two, the instances
of each script don't always start close to the same time, and the processing
time changes. Let say it takes one client request 2 seconds to fulfill. If 3
or 4 or 5 requests come in together, the processing time doubles. Maybe two
instances start at the same time and the others start after the prior has
completed. In the end, it's as if multiple simultaneous requests get
shuffled into a first come first serve queue, processing goes up, and I get
a bottleneck. I expect processing to go up, but slightly. What I need is
multiple simultaneous requests to be processed at the same time and without
increasing the processing time by much.

Am I under a false impression? Is there something I can do to achieve this
or somewhere I can turn to find out more on the subject?

Thanks,
Bernie