O/S - cpueblo.com

ab 를 이용한 웹서버 벤치마킹


글쓴이 : 유광희 날짜 : 2014-04-08 (화) 23:30 조회 : 18166

Apach Bench 를 이용한 벤치마킹

 

Apache Bench 를 이용한 벤치마킹 방법 입니다.

< 1만번 실행, 동시접속 10건을 10회 반복 시험하여 총 소요 시간을 측정 >

 

# for i in {1..10}; do ab -k -q -n 10000 -c 10 http://localhost/index.php | grep "Time taken"; done

 

Time taken for tests:  15.680 seconds

Time taken for tests:  20.248 seconds

 

 

< 1만번 실행, 동시접속 100건을 1회 시험하여 나오는 정보 >

[root@localhost ~]$ ab -k -q -n 100 -c 10 https://localhost/index.php

 

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

 

Benchmarking localhost (be patient).....done

 

 

Server Software:        Apache/2.2.15

Server Hostname:        localhost

Server Port:            443

SSL/TLS Protocol:       TLSv1/SSLv3,DHE-RSA-AES256-GCM-SHA384,2048,256

 

Document Path:          index.php

Document Length:        546 bytes

 

Concurrency Level:      10

Time taken for tests:   1.274 seconds

Complete requests:      100

Failed requests:        0

Write errors:           0

Keep-Alive requests:    0

Total transferred:      93400 bytes

HTML transferred:       54600 bytes

Requests per second:    78.50 [#/sec] (mean)

Time per request:       127.392 [ms] (mean)

Time per request:       12.739 [ms] (mean, across all concurrent requests)

Transfer rate:          71.60 [Kbytes/sec] received

 

Connection Times (ms)

              min  mean[+/-sd] median   max

Connect:        7   16   8.3     13      45

Processing:    13   56 112.4     46    1159

Waiting:       13   55 112.4     46    1159

Total:         24   72 112.9     62    1179

 

Percentage of the requests served within a certain time (ms)

  50%     62

  66%     65

  75%     70

  80%     73

  90%     82

  95%     89

  98%    106

  99%   1179

 100%   1179 (longest request)

[projectb@mainweb1 ~]$

 

https://httpd.apache.org/docs/2.2/ko/programs/ab.html 에서 자세한 옵션을 보실 수 있습니다.

Q. 실행시 socket: Too many open files (24) 발생합니다.
A. ulimit -n 10000 등 개수를 다시 지정한 후 실행하세요.
ulimit 은 프로세스당 열수 있는 파일 수를 조정합니다.