Bug 56604 - ApacheBench custom http methods support
Summary: ApacheBench custom http methods support
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: support (show other bugs)
Version: 2.4.9
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: FixedInTrunk, PatchAvailable
: 44851 (view as bug list)
Depends on:
Reported: 2014-06-06 23:21 UTC by Roman Jurkov
Modified: 2014-07-22 23:12 UTC (History)
2 users (show)

unified diff (1.85 KB, patch)
2014-06-06 23:25 UTC, Roman Jurkov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Jurkov 2014-06-06 23:21:16 UTC
ab command should have an ability to use custom HTTP methods, and all of the standard methods.

It is a very simple change, where we could include additional "-m" flag 

usage would be like this: "ab -n 1 -m PING"

sample output:
winfinit$ support/ab -v 9 -m PING -n 1
This is ApacheBench, Version 2.3 <$Revision$>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking (be patient)...INFO: PING header == 
User-Agent: ApacheBench/2.3
Accept: */*

LOG: header received:
HTTP/1.1 200 OK
Date: Fri, 06 Jun 2014 20:51:39 GMT
Server: Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/0.9.8y mod_cluster/1.3.1.dev DAV/2
Connection: close
Content-Type: text/plain


LOG: Response code = 200

Server Software:        Apache/2.2.26
Server Hostname:
Server Port:            6666

Document Path:          /
Document Length:        37 bytes

Concurrency Level:      1
Time taken for tests:   0.001 seconds
Complete requests:      1
Failed requests:        0
Total transferred:      226 bytes
HTML transferred:       37 bytes
Requests per second:    1858.74 [#/sec] (mean)
Time per request:       0.538 [ms] (mean)
Time per request:       0.538 [ms] (mean, across all concurrent requests)
Transfer rate:          410.23 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     0    0   0.0      0       0
Waiting:        0    0   0.0      0       0
Total:          1    1   0.0      1       1


sample help output:
winfinit$ support/ab -m PING -n 1 -v
support/ab: wrong number of arguments
Usage: support/ab [options] [http[s]://]hostname[:port]/path
Options are:
    -n requests     Number of requests to perform
    -c concurrency  Number of multiple requests to make at a time
    -t timelimit    Seconds to max. to spend on benchmarking
                    This implies -n 50000
    -s timeout      Seconds to max. wait for each response
                    Default is 30 seconds
    -b windowsize   Size of TCP send/receive buffer, in bytes
    -B address      Address to bind to when making outgoing connections
    -p postfile     File containing data to POST. Remember also to set -T
    -u putfile      File containing data to PUT. Remember also to set -T
    -T content-type Content-type header to use for POST/PUT data, eg.
                    Default is 'text/plain'
    -v verbosity    How much troubleshooting info to print
    -w              Print out results in HTML tables
    -i              Use HEAD instead of GET
    -x attributes   String to insert as table attributes
    -y attributes   String to insert as tr attributes
    -z attributes   String to insert as td or th attributes
    -C attribute    Add cookie, eg. 'Apache=1234'. (repeatable)
    -H attribute    Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
                    Inserted after all normal header lines. (repeatable)
    -A attribute    Add Basic WWW Authentication, the attributes
                    are a colon separated username and password.
    -P attribute    Add Basic Proxy Authentication, the attributes
                    are a colon separated username and password.
    -X proxy:port   Proxyserver and port number to use
    -V              Print version number and exit
    -k              Use HTTP KeepAlive feature
    -d              Do not show percentiles served table.
    -S              Do not show confidence estimators and warnings.
    -q              Do not show progress when doing more than 150 requests
    -l              Accept variable document length (use this for dynamic pages)
    -g filename     Output collected data to gnuplot format file.
    -e filename     Output CSV file with percentages served
    -r              Don't exit on socket receive errors.
    -m method       Method name.
    -h              Display usage information (this message)
    -Z ciphersuite  Specify SSL/TLS cipher suite (See openssl ciphers)
    -f protocol     Specify SSL/TLS protocol
                    (SSL2, SSL3, TLS1 or ALL)
Comment 1 Roman Jurkov 2014-06-06 23:25:39 UTC
Created attachment 31696 [details]
unified diff
Comment 2 Yann Ylavic 2014-06-07 08:47:23 UTC
Thanks, committed in r1601076.
Comment 3 Roman Jurkov 2014-06-07 16:39:39 UTC
*** Bug 44851 has been marked as a duplicate of this bug. ***
Comment 4 Roman Jurkov 2014-07-22 23:12:06 UTC
released in 2.4.10