apache/httpd — pull request #11 by winfinit (2014-06-06 18:42:39+00:00)
Title: Specify method to ab

It is useful to be able to benchmark applications that implement "DELETE" methods, and other non standard methods, ApacheBench is a very useful tool to do POST/PUT/GET requests, this change will allow one to specify any method with either POST or PUT bindings.

```bash
romans-air:httpd winfinit$ support/ab -h
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.
'application/x-www-form-urlencoded'
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)
```

sample command and output:

```bash
romans-air:httpd winfinit$ support/ab -m PING -n 1 -v 9 http://127.0.0.1:6666/
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 127.0.0.1 (be patient)...INFO: PING header ==
---
PING / HTTP/1.0
Host: 127.0.0.1:6666
User-Agent: ApacheBench/2.3
Accept: */*

---
LOG: header received:
HTTP/1.1 200 OK
Date: Fri, 06 Jun 2014 18:37:54 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

Type=PING-RSP&State=OK&id=-322559617

LOG: Response code = 200
..done

Server Software: Apache/2.2.26
Server Hostname: 127.0.0.1
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: 1572.33 [#/sec] (mean)
Time per request: 0.636 [ms] (mean)
Time per request: 0.636 [ms] (mean, across all concurrent requests)
Transfer rate: 347.02 [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
```