cygwin で ab を導入

Windows PC で ab (apache bench) を使いたいと思った。

setup-x86.exe の最新版をダウンロードしてきて実行する。
Select Packages の画面で View を Full にして Search 欄に ab を入力するとたくさんリストアップされる、それらしいものがない。
ab 単体のパッケージはない。

Search 欄に httpd を入力すると、パッケージ名に httpd を含むものがリストアップされる。
それらしいパッケージとして httpd-tools: Apache HTTP Server (tools) がある。

内容がわからない。

なんかないかと思って、CygwinのWebサイトを見ると、左サイドのメニューに Search Packages の項目がある。

パッケージの内容を検索できるっぽい。
テキストボックスに httpd-tools を入力してGoをクリック。
検索結果はパッケージのリストだった。
パッケージ名のリンク、今回は httpd-tools-2.4.25-3 が最新だったので、それをクリック。
httpd-tools: Apache HTTP Server (tools)
以下のような感じでパッケージに含まれるファイルがリストアップされる。

2017-04-20 04:20           0 usr/bin/
2017-04-20 04:19       50717 usr/bin/ab.exe
2017-04-20 04:20       19997 usr/bin/htdbm.exe
2017-04-20 04:20       13341 usr/bin/htdigest.exe
2017-04-20 04:20       19485 usr/bin/htpasswd.exe
2017-04-20 04:20       13341 usr/bin/httxt2dbm.exe
2017-04-20 04:20       12317 usr/bin/logresolve.exe
2017-04-20 04:19           0 usr/share/man/man1/
2015-05-07 16:25        3652 usr/share/man/man1/ab.1.gz
2012-12-12 16:32        3125 usr/share/man/man1/htdbm.1.gz
2012-07-19 10:26         926 usr/share/man/man1/htdigest.1.gz
2014-06-24 05:53        3003 usr/share/man/man1/htpasswd.1.gz
2013-03-20 12:43         812 usr/share/man/man1/httxt2dbm.1.gz
2012-01-09 17:03         746 usr/share/man/man1/logresolve.1.gz

ab.exe が含まれている!

setupに戻り、Select Packages の画面で httpd-tools の New 欄をクリックして、
インストールしたいバージョンに表示を切替え、インストールを進める。

$ ab -h
Usage: 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)
    -I              Disable TLS Server Name Indication (SNI) extension
    -Z ciphersuite  Specify SSL/TLS cipher suite (See openssl ciphers)
    -f protocol     Specify SSL/TLS protocol
                    (SSL3, TLS1, TLS1.1, TLS1.2 or ALL)
$ ab -V
This is ApacheBench, Version 2.3 <$Revision: 1757674 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/