LoginSignup
2
3

More than 5 years have passed since last update.

vagrantに設置したnginxにApacheBenchで負荷をかけてみる

Posted at

環境

vagrantに設置したCentOS
CentOS release 6.9 (Final)

MacからApache Benchで負荷をかけてみる

Apache Benchインストール

MacにはもともとApacheがインストールされているので、それをそのまま利用する
Server version: Apache/2.4.27 (Unix)

Apache Benchの実行

$ ab -n 1000 -c 100 http://192.168.33.10/

nは実行するリクエスト回数
cはコネクション数

Server Software:        nginx/1.12.2
Server Hostname:        192.168.33.10
Server Port:            80

Document Path:          /
Document Length:        612 bytes

Concurrency Level:      100
Time taken for tests:   0.871 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      845000 bytes
HTML transferred:       612000 bytes
Requests per second:    1147.97 [#/sec] (mean)
Time per request:       87.111 [ms] (mean)
Time per request:       0.871 [ms] (mean, across all concurrent requests)
Transfer rate:          947.30 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   1.2      0       5
Processing:     3   84  18.6     91     103
Waiting:        3   84  18.6     91     103
Total:          8   85  17.8     92     103

Percentage of the requests served within a certain time (ms)
  50%     92
  66%     93
  75%     94
  80%     94
  90%     97
  95%    100
  98%    101
  99%    102
 100%    103 (longest request)

Complete requests
ただ単にnginxを設置しただけなので全て成功

Requests per second
1秒間に処理したリクエスト数の平均

Time per request
1リクエストの処理にかかった時間

Connection Times (ms)
Connect・・・接続の確立までにかかる時間。同マシンなので流石に速い
Waiting・・・クライアントが接続確立からレスポンスを受けるまでの時間
Processing・・・サーバー側の処理時間

同じマシンから負荷をかけているせいか殆どWaitingとProcessingに差が見られず

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3