Bug 48497 - apachebench keepalive option sends an incorrect number of requests
Summary: apachebench keepalive option sends an incorrect number of requests
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: support (show other bugs)
Version: 2.2.14
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2010-01-06 16:39 UTC by Bryn Dole
Modified: 2010-05-03 13:34 UTC (History)
0 users



Attachments
patch to fix ab.c ton only send the correct number of requests for keepalive sessions (1.04 KB, patch)
2010-01-06 16:39 UTC, Bryn Dole
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bryn Dole 2010-01-06 16:39:02 UTC
Created attachment 24807 [details]
patch to fix ab.c ton only send the correct number of requests for keepalive sessions

ab -k -n 1 http://www.example.com/

will send more than one GET request. The problem is worse for higher concurrency levels.  The issue is how the started connections is counted.

I first discovered this watching a tcp dump of ab at work. It would consistently send one extra GET request per connection and then close the tcp session before the reply would return. Resulting in a TCP RST packet. 

I'm attaching a patch that actually simplifies the accounting of started requests and prevents apachebench from starting more requests than it should.
Comment 1 Dan Poirier 2010-05-03 13:34:40 UTC
Fix committed to trunk as r940526.  Thanks for the patch.