httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] apache problems with number of cgi requests
Date Tue, 04 Aug 2009 06:48:30 GMT
Digvijoy Chatterjee wrote:
> So there are two scripts I am using as a test firefox 3.0.8 , launch
> test.cgi and you can see it provides a link to another cgi script
> which sleeps for 60 seconds.
> I launch this link again and again in a new tab/window , but any given
> time only one process has been started by apache on the host.
And what happens when you do this from 2 *different* workstations at the 
same time, or, on the same workstation, with 2 entirely different 
browsers (I mean 1 x Firefox and 1 x IE for instance) ?

The point is :
A browser may open one single connection to the server, and use that 
same connection to send several requests.  That is what is called 
"keepalive" connections.  On the server side, this results in this one 
connection being handed over to one single Apache "child", and this 
single child keeps the connection open and processes all requests on 
that connection, one after the other.
No matter how many windows or tabs you open in the same browser, it 
*may* still be using only that one connection, for all its windows or tabs.
But two different browsers (or the same browser on two different 
workstations) will not share one connection.

Since you are anyway using perl for your cgi scripts, why don't you 
create a simple perl script, using the LWP module, to make the requests 
to Apache ? You could then run several instances of this script in 
different console windows at the same time, and check the results.

Attached is such a script, but I don't know if it will make it to the 
list. If not, ask and I will send it to you privately.

There also exist lots of other possibilities, such as creating a small 
shell script which calls wget or curl repeatedly, and run that script in 
several consoles.
You can also, I believe, use the "ab" program which comes with Apache.
See here :

View raw message