You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@covalent.net> on 1999/05/02 14:23:22 UTC

[PATCH] FW: Bug in AB and patch to fix it.

Acked.

-----Original Message-----
From: Alejandro Forero [mailto:azul@azul.dhis.org]
Sent: Saturday, May 01, 1999 8:53 PM
To: apache@apache.org
Subject: Bug in AB and patch to fix it.


Hi. :)

The guys at ZDNet downloaded one CGI application I made and told me
they
had been testing it but it was failing to report things correctly.
They
said that when they made 1000 requests with a concurrency of 100
simultaneous requests, my CGI application reported to have received
1099
hits. I, who didn't know of AB then, did my own script to test it and
didn't found any problems. I mailed them back asking them, among many
other things, what program they were using for their tests. The Apache
benchmarking tool.

I got it and tried it. I found there was an error on it:

% ab -c 100 -n 1000 http://localhost/fffff >/dev/null
% grep -c ffffff ~web/logs/error_log
1083

Oh. So I tell it to do 1000 requests but it does 1083. There is an
error
there.

I took a look at the code and I hacked the function write_request,
adding
a counter for the number of requests made, so it won't make any
requests
more than I told it to make. I am not sure what happens when requests
time
out or a connection is suddenly closed before the request is
completed. If
AB's current policy is to retry failed attempts, my current hack may
introduce another bug (AB would hang if an attempt times out) and you
will want to code a solution your selves.

Anyway, you may take a look at the little patch I am attaching, which
fixes that bug which made the ZD guys think my Pollera CGI application
was
buggy. ;)

Alejo.

--
"I am enough of an artist to draw freely upon my imagination.
Imagination
is more important than knowledge. Knowledge is limited. Imagination
encircles the world." Albert Einstein.