Linux WEB

웹부하 테스트 - httperf

2015.09.18 14:42

호스트웨이 조회 수:8988

httperf 은 웹서버에 부하를 발생 시켜 성능을 측정하는 도구입니다.


- 설치

[root@apm ]# tar zxvf httperf-0.9.0.tar.gz

[root@apm ]# cd httperf-0.9.0
[root@apm httperf-0.9.0]# ./configure
[root@apm httperf-0.9.0]# make && make install

- 옵션
[root@apm httperf-0.9.0]# httperf --help
Usage: httperf [-hdvV] [--add-header S] [--burst-length N] [--client N/N]
        [--close-with-reset] [--debug N] [--failure-status N]
        [--help] [--hog] [--http-version S] [--max-connections N]
        [--max-piped-calls N] [--method S] [--no-host-hdr]
        [--num-calls N] [--num-conns N] [--period [d|u|e]T1[,T2]]
        [--port N] [--print-reply [header|body]] [--print-request [header|body]]
        [--rate X] [--recv-buffer N] [--retry-on-failure] [--send-buffer N]
        [--server S] [--server-name S] [--session-cookies]
        [--ssl] [--ssl-ciphers L] [--ssl-no-reuse]
        [--think-timeout X] [--timeout X] [--uri S] [--verbose] [--version]
        [--wlog y|n,file] [--wsess N,N,X] [--wsesslog N,X,file]
        [--wset N,X]
[root@apm httperf-0.9.0]#

- 실행 예제
[root@apm httperf-0.9.0]# httperf --server=localhost --port=80 --num-conns=80000 --rate=100 --timeout=5 --think-timeout=5 --hog
httperf --hog --think-timeout=5 --timeout=5 --client=0/1 --server=localhost --port=80 --uri=/ --rate=50 --send-buffer=4096 --recv-buffer=16384 --num-conns=500 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1

Total: connections 500 requests 500 replies 500 test-duration 9.981 s

Connection rate: 50.1 conn/s (20.0 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 0.1 avg 0.7 max 4.6 median 0.5 stddev 0.9
Connection time [ms]: connect 0.0
Connection length [replies/conn]: 1.000

Request rate: 50.1 req/s (20.0 ms/req)
Request size [B]: 62.0

Reply rate [replies/s]: min 50.0 avg 50.0 max 50.0 stddev 0.0 (1 samples)
Reply time [ms]: response 0.7 transfer 0.0
Reply size [B]: header 235.0 content 45.0 footer 0.0 (total 280.0)
Reply status: 1xx=0 2xx=500 3xx=0 4xx=0 5xx=0

CPU time [s]: user 1.29 system 8.69 (user 12.9% system 87.0% total 99.9%)
Net I/O: 16.7 KB/s (0.1*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
[root@apm httperf-0.9.0]#

- 설명
httperf --server=localhost --port=80 --num-conns=800 --rate=100 --timeout=5 --think-timeout=5 --hog

localhost 주소의 서비에 80번 포트로 1초에 100개씩 800개의 접속을 시도 합니다. 또, 5초간 요청에 대한 응답이 없을 경우 timeout error로 처리 합니다.
웹 서버가 정상 요청 처리를 진행 할 경우 10초 후 결과가 확인 됩니다.

감사합니다.

번호 제목 글쓴이 날짜 조회 수
63 아파치 특정폴더에 암호걸기 호스트웨이 2012.12.28 8163
62 PHP 컴파일시 에러 메세지가 나오는 경우 조치방법-2 호스트웨이 2012.12.20 6123
61 PHP 컴파일시 에러 메세지가 나오는 경우 조치방법 호스트웨이 2012.12.14 10310
60 Ubuntu 아파치 웹서버에서 index.php 다운로드 창이 뜰 경우 호스트웨이 2012.12.13 8181
59 Symbolic link not allowed or link target not accessible 에러 발생 시 호스트웨이 2012.11.16 10541
58 CentOS6 64bit openssl 설치시 에러 조치사항 호스트웨이 2012.11.02 7605
57 [php] 세션 유지시간 설정하기 호스트웨이 2012.10.25 17769
56 Apache 재시작시 세션 끊어짐 현상 호스트웨이 2012.10.12 12738
55 apache 구동시 "파일 크기 제한을 초과함 $HTTPD -DSSL" 에러메시지 출력에 대한 해결방법 호스트웨이 2012.10.11 9400
54 failed to open stream: Too many open files in 에러메시지 출력 시 해결방법 호스트웨이 2012.10.03 7621
53 httpd-2.4 설치하기 호스트웨이 2012.09.27 14436
52 아파치 실행시 libphp5.so 에러 호스트웨이 2012.09.14 13523
51 apache internal dummy connection 로그 생성 방지하기 호스트웨이 2012.09.06 18689
50 SSL 패스워드 삭제 하기 호스트웨이 2012.09.05 20690
49 Apache Max Client 값 수정 호스트웨이 2012.08.31 19627
48 Nginx 설치 호스트웨이 2012.08.31 14896
47 nginx - redirect 설정 호스트웨이 2012.08.24 17883
46 CentOS 6.3 에 apache, php, mysql, phpmyadmin(LAMP) 설치하기 #2 호스트웨이 2012.08.07 14202
45 CentOS 6.3 에 apache, php, mysql, phpmyAdmin(LAMP) 설치하기 #1 호스트웨이 2012.08.07 17343
44 PHP 사용 시 특정함수 사용제한 하는 방법 호스트웨이 2012.08.03 11502