Bug 10038 - ab benchmaker hangs on 10K https URLs with keepalive
Summary: ab benchmaker hangs on 10K https URLs with keepalive
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.3.25
Hardware: Other Linux
: P3 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-20 03:25 UTC by Jason Haar
Modified: 2008-08-01 19:22 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Haar 2002-06-20 03:25:10 UTC
I have compiled ab with USE_SSL under 1.3.26 and have been using it to benchmark
our https servers. It was working well: I was using 1k,10k and 100k documents as
the test URLs (made of NULL chars if that matters).

Anyway, "ab -n 100 https://xxxxx/test/10K.txt" works fine, but 
"ab -n 100 -k https://xxxxx/test/10K.txt" hangs after the first hit.

Doing "-k" works fine on the 1K and 100K files, so I'm thinking there's
something  that just happens to hit a buffer limit or the likes on that
particular 10K file.

Anyway, curl and a browser has no problem with the URL, neither does ab if I
make it get the URL via a stunnel tunnel.

Great tool BTW :-)
Comment 1 patrick mcmanus 2003-02-19 21:14:50 UTC
I just had this problem too.. this patch is one way to address the problem (I
had it on 2.0.44)

--- ab.c        Wed Oct 16 08:39:21 2002
+++ new.c       Wed Feb 19 17:07:54 2003
@@ -762,12 +762,6 @@
 #endif
        e = apr_send(c->aprsock, request + c->rwrote, &l);
 
-       /*
-        * Bail early on the most common case
-        */
-       if (l == c->rwrite)
-           break;
-
 #ifdef USE_SSL
         if (ssl != 1)
        if (e != APR_SUCCESS) {
@@ -784,7 +778,7 @@
 #endif
        c->rwrote += l;
        c->rwrite -= l;
-    } while (1);
+    } while (c->rwrite != 0);
 
     totalposted += c->rwrite;
     c->state = STATE_READ;
Comment 2 Roy T. Fielding 2008-05-12 14:06:16 UTC
Fixed in trunk (r655637).

Color me stunned that this bug persisted for five years after a patch was provided, apparently because it targets the old httpd-1.3 product.
Comment 3 Ruediger Pluem 2008-05-27 15:14:54 UTC
Backported to 2.2.x as r660576 (http://svn.apache.org/viewvc?rev=660576&view=rev).
Comment 4 Roy T. Fielding 2008-08-01 19:22:22 UTC
ab.c in 1.3.x has a completely different implementation of
the request writing and does not suffer from the bug fixed
by the proposed patch (which is based on a later implementation
in 2.x and has now been fixed for 2.0.x and 2.2.x).

However, ab.c in 1.3.x also has a completely broken SSL
implementation that does not work and probably should be removed.
My guess is that the keepalive code is equally broken.
I suggest that anyone who wants to run ab against an httpd
(any version) should use the one in 2.2.9 or later.

If anyone does revisit this bug, I suspect the hang may be due
to close_connection not doing an SSL_shutdown (compare it to the
implementation in 2.2.x).