アパッチの性能をテストするには?

ショコラ
ショコラ

アパッチの性能をテストするには?

「ab -c {同時接続数} -n {リクエスト数} {アクセスするURL}」でキメマス。

もっさん先輩
もっさん先輩
ab -c {同時接続数} -n {リクエスト数} {アクセスするURL}

ab -c 100 -n 100 https://answorz.com/index.html

ダメなパターンも書いておきます。ドメインだけではダメでした。「/」かパスが必要です。

ab -c 100 -n 100 https://answorz.com

↓こちらは abコマンドを実行した結果です。

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

Benchmarking answorz.com (be patient).....done


Server Software:        nginx
Server Hostname:        answorz.com
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Server Temp Key:        X25519 253 bits
TLS Server Name:        answorz.com

Document Path:          /
Document Length:        190 bytes

Concurrency Level:      100
Time taken for tests:   0.417 seconds
Complete requests:      100
Failed requests:        19
   (Connect: 0, Receive: 0, Length: 19, Exceptions: 0)
Non-2xx responses:      81
Total transferred:      1889443 bytes
HTML transferred:       1870075 bytes
Requests per second:    240.06 [#/sec] (mean)
Time per request:       416.563 [ms] (mean)
Time per request:       4.166 [ms] (mean, across all concurrent requests)
Transfer rate:          4429.48 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       11  359  48.1    381     384
Processing:     9   34  48.6     10     399
Waiting:        0   26  29.1      9      74
Total:        386  393   5.0    394     409

Percentage of the requests served within a certain time (ms)
  50%    394
  66%    394
  75%    394
  80%    394
  90%    398
  95%    404
  98%    404
  99%    409
 100%    409 (longest request)

〔実行結果の説明〕
・Complete requests:100 ←総リクエスト数
・Failed requests:19 ←失敗した数
・Requests per second:240.06 [#/sec] (mean) ←1秒間で処理した数
・Time per request: 4.166 [ms] (mean, across all concurrent requests) ←1リクエストにかかった時間

Scroll to Top