Apache Benchを使ってみる

-nには、Totalで発行するリクエスト数を指定
-cには、同時接続数を指定

$ ab -n -c <同時接続数>
Complete requestsがリクエストに成功

$ ab -n 100 -c 100 -P id:password https://*.co.jp/ 

$ ab -n 100 -c 100 https://www.google.com/
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.google.com (be patient)…..done

Server Software: gws
Server Hostname: www.google.com
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-ECDSA-CHACHA20-POLY1305,256,256
Server Temp Key: X25519 253 bits
TLS Server Name: www.google.com

Document Path: /
Document Length: 15095 bytes

Concurrency Level: 100
Time taken for tests: 5.690 seconds
Complete requests: 100
Failed requests: 99
(Connect: 0, Receive: 0, Length: 99, Exceptions: 0)
Total transferred: 1611214 bytes
HTML transferred: 1505980 bytes
Requests per second: 17.58 [#/sec] (mean)
Time per request: 5689.514 [ms] (mean)
Time per request: 56.895 [ms] (mean, across all concurrent requests)
Transfer rate: 276.55 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 534 1480 684.7 1113 2959
Processing: 189 1196 500.7 1350 3571
Waiting: 120 720 301.6 563 1339
Total: 723 2677 799.6 2599 5033

Percentage of the requests served within a certain time (ms)
50% 2599
66% 2936
75% 2958
80% 2977
90% 3549
95% 5022
98% 5032
99% 5033
100% 5033 (longest request)

Requests per second:17.58 [#/sec] (mean) が1秒間に捌けるリクエスト
Time per request: が1秒間に捌けるリクエスト

なるほど、apache benchの概念を理解した