웹서버 성능 테스트 도구 AB (Apache Bench)

웹서버의 성능 테스트를 위해서 접속을 강제로 늘려서 부하를 주는 스트레스 테스트가 일반적이다.

보통은 AB라고 하는 Apache Bench를 주로 사용한다.

 

http://httpd.apache.org/docs/2.4/en/programs/ab.html

 

설치도 쉽고 사용법도 상당히 간단해서 즉시 사용하기 좋은편이다.

 

설치법

Redhat / Centos :  yum install httpd-tools

ubuntu : sudo apt-get install apache2-utils

 

주요 옵션

-n 성능 검사를 위해 보내는 요청 수

-c 동시 접속수 (client)

-C Cookie 헤더

-H 요청에 헤더 추가

-i GET 대신 HEAD 요청

-k KeepAlive

-p POST

 

사용법 예시

ab -n 100 -c 10 http://google.com

– 10명이 10번 요청

 

ab -n 400 -c 10 -H “Accept-Encoding: gzip,deflate” http://google.com

– 10명이 400번 요청, Accept-Encoding: gzip,deflate 헤더 포함

 

실행 결과

[root@localhost ~]$ ab -n 100 -c 10 http://www.google.com/

 

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
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:            80

Document Path:          /                                 #경로
Document Length:        13308 bytes                  #문서 크기

Concurrency Level:      10
Time taken for tests:   1.486 seconds                  #전체 테스트 소요시간
Complete requests:      100                              #응답 완료한 요청수
Failed requests:        96                                   #실패한 요청수
(Connect: 0, Receive: 0, Length: 96, Exceptions: 0)
Write errors:           0
Total transferred:      1399784 bytes
HTML transferred:       1330184 bytes
Requests per second:    67.31 [#/sec] (mean)         #초당 응답 요청수
Time per request:       148.572 [ms] (mean)           #요청당 응답시간
Time per request:       14.857 [ms] (mean, across all concurrent requests)
Transfer rate:          920.07 [Kbytes/sec] received    #초당 전송량

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:       29   33   2.5     32      39
Processing:    92  100   5.0    100     124
Waiting:       91   99   4.9     98     123
Total:        122  133   6.6    131     156

Percentage of the requests served within a certain time (ms)
50%    131
66%    135
75%    138
80%    139
90%    142
95%    144
98%    150
99%    156
100%    156 (longest request)

0 0 votes
Article Rating
Subscribe
Notify of
guest

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.

0 Comments
Inline Feedbacks
View all comments
Scroll to top
0
Would love your thoughts, please comment.x
()
x