메뉴 닫기

아파치 벤치마킹 툴 사용하기

ab(apache benchmark)는 Apache Web server의 상태를 측정하는 툴입니다. 초당 Apache server가 얼마나 많은 요청을 처리할수 있는지를 측정할수 있습니다

아파치를 설치하면 기본적으로 있는 툴입니다

[root@localhost]# /usr/local/apache/bin/ab –help    < 로 다음과같이 옵션값과 사용법을 볼 수 있습니다.

Usage: /usr/local/apache/bin/ab [options] [http[s]://]hostname[:port]/path

-n requests     측정을하기위한 요청수를 지정합니다.

-c concurrency 동시접속수

-t timelimit 시간제한

-b windowsize 

-k HTTP KeepAlive (연결 지속성)

-A Authorization username:password 기본인증지원

-v  출력 레벨을 지정합니다.

등등 

사용법 은 ab뒤에 옵션값을 붙인뒤 도메인명을 씁니다.
[root@localhost]# /usr/local/apache/bin/ab -n 100 -c 10 http://www.domain.com/
10 명의 유저가 동시에 http://www.domain.com/ 을 요청
각각의 유저는 저 도메인으로 요청을 10 번씩 하게 됩니다.

[root@localhost] # /usr/local/apache/bin/ab -n 1500 -c 50 http://www.domain.com/
요청을 30 x 50 (50 명의 사용자가, 각각 30 번의 요청)

예시로 naver.com을 테스트해보았습니다

[root@localhost ~]# /usr/local/apache/bin/ab -n 100 -c 10 http://naver.com/
This is ApacheBench, Version 2.3 <$Revision: 1373084 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking naver.com (be patient)…..done

Server Software: nginx —> 아파치 버전표시
Server Hostname: naver.com—> 특정사이트의 도메인명
Server Port: 80 —> 웹서비스 사용포트

Document Path: / —> 초기문서가 존재하는 웹문서 root 위치
Document Length: 178 bytes—> 초기문서의 용량크기(index.html)

Concurrency Level: 10
Time taken for tests: 0.068 seconds—> 응답시간 (매우 중요한 결과값임)
Complete requests: 100—> 요구에 응답완료한 세션수
Failed requests: 0—> 요구에 응답실패한 세션수
Write errors: 0
Non-2xx responses: 100
Total transferred: 40100 bytes —> 총 전송바이트수
HTML transferred: 17800 bytes—> 총 전송한 html 바이트수
Requests per second: 1465.65 [#/sec] (mean) —> 초당응답요구수
Time per request: 6.823 [ms] (mean)—> 요구에 응답한 시간
Time per request: 0.682 [ms] (mean, across all concurrent requests)
Transfer rate: 573.95 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 2 3 0.5 3 5
Processing: 3 3 0.4 3 5
Waiting: 3 3 0.4 3 5
Total: 5 6 0.7 6 9

Percentage of the requests served within a certain time (ms)
50% 6
66% 7
75% 7
80% 7
90% 7
95% 8
98% 8
99% 9
100% 9 (longest request)

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다