호스팅 사용법
호스팅 신청하기
도메인 연결하기
홈페이지 올리기
이메일 설정하기
서버 사용법
FTP사용법
메일사용법
텔넷/리눅스
MySQL사용법
MSSQL사용법
리눅스명령어 모음
시스템사용법
서버세팅
네트워크/보안
L4 매뉴얼
백업/미러링
호스팅용어 모음
프로그램 사용법
알리미사용법
제로보드설치방법
워드프레스설치방법
태터툴즈설치방법
그누보드설치방법
우편번호DB사용법
폼메일사용법
주문서사용법
예전 게시판/방명록
전자지불 서비스


HOME > 호스팅 > 사용안내 > 시스템사용법 > 아파치 성능 체크
데몬보안설정하기  시스템변경 여부확인  웹서버 시스템 최적화 
한 IP당 동시 접속량 제한  아파치 성능 체크  SMTP relay설정하기 
debugfs 활용하기(삭제된 파일 복구)  dig활용하기  mod_dosevasive 활용하기(아파치 DOS막기) 
mod_throttle 활용하기(아파치 트래픽제어)  procmail을 통한 메일필터링  ps 활용하기(cpu점유율 높은 프로세스 찾기) 
server 시간맞추기  IP 관련 설정하기 

  • 1. 개요
    ab는 ApacheBanch의 약자로, 웹서버의 성능을 체크할 수 있다.

    2. ab 명령 옵션
    ab 명령에 사용할 수 있는 옵션은 다음과 같다.

    [root@qmail bin]# ./ab
    ./ab: wrong number of arguments
    Usage: ./ab [options] [http://]hostname[:port]/path
    Options are:
    -n requests Number of requests to perform
    -c concurrency Number of multiple requests to make
    -t timelimit Seconds to max. wait for responses
    -p postfile File containg data to POST
    -T content-type Content-type header for POSTing
    -v verbosity How much troubleshooting info to print
    -w Print out results in HTML tables
    -i Use HEAD instead of GET
    -x attributes String to insert as table attributes
    -y attributes String to insert as tr attributes
    -z attributes String to insert as td or th attributes
    -C attribute Add cookie, eg. 'Apache=1234' (repeatable)
    -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: zop'
    Inserted after all normal header lines. (repeatable)
    -A attribute Add Basic WWW Authentication, the attributes
    are a colon separated username and password.
    -P attribute Add Basic Proxy Authentication, the attributes
    are a colon separated username and password.
    -X proxy:port Proxyserver and port number to use
    -V    Print version number and exit
    -k    Use HTTP KeepAlive feature
    -d    Do not show percentiles served table.
    -S    Do not show confidence estimators and warnings.
    -g filename    Output collected data to gnuplot format file.
    -e filename    Output CSV file with percentages served
    -h     Display usage information (this message)

    3. ab로 아파치 성능 체크 예제
    (1) 기본 옵션 (default)으로 체크

    [root@qmail bin]# ./ab http://zeroboard.com/
    This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
    Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
    Benchmarking zeroboard.com (be patient).....done
    Server Software: Apache/2.2.11
    Server Hostname: zeroboard.com
    Server Port: 80
    Document Path: /
    Document Length: 330 bytes
    Concurrency Level: 1
    Time taken for tests: 0.002 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Non-2xx responses: 1
    Total transferred: 585 bytes
    HTML transferred: 330 bytes
    Requests per second: 500.00 [#/sec] (mean)
    Time per request: 2.00 [ms] (mean)
    Time per request: 2.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 292.50 [Kbytes/sec] received

    (2) -n (request 요청 수) 옵션을 설정하여 체크
    * request 요청 수를 10으로 하여 체크하는 방법은 다음 명령을 수행하면 된다.

    [root@qmail bin]# ./ab -n 10 http://zeroboard.com/
    This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
    Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
    Benchmarking zeroboard.com (be patient).....done
    Server Software: Apache/2.2.11
    Server Hostname: zeroboard.com
    Server Port: 80
    Document Path: /
    Document Length: 330 bytes
    Concurrency Level: 1
    Time taken for tests: 0.023 seconds
    Complete requests: 10
    Failed requests: 0
    Broken pipe errors: 0
    Non-2xx responses: 10
    Total transferred: 5850 bytes
    HTML transferred: 3300 bytes
    Requests per second: 434.78 [#/sec] (mean)
    Time per request: 2.30 [ms] (mean)
    Time per request: 2.30 [ms] (mean, across all concurrent requests)
    Transfer rate: 254.35 [Kbytes/sec] received
    Connnection Times (ms)
    min mean[+/-sd] median max
    Connect: 0 0 0.0 0 1
    Processing: 1 2 0.0 2 2
    Waiting: 1 1 0.0 1 1
    Total: 2 2 0.0 2 2
    ERROR: The median and mean for the initial connection time are more than twice the standard
    deviation apart. These results are NOT reliable.
    ERROR: The median and mean for the processing time are more than twice the standard
    deviation apart. These results are NOT reliable.

    Percentage of the requests served within a certain time (ms)
    50% 2
    66% 2
    75% 2
    80% 2
    90% 2
    95% 2
    98% 2
    99% 2
    100% 2 (last request)

    (3) -c (다중 세션 요청 수) 옵션으로 체크

    [root@qmail bin]# ./ab -c 10 http://zeroboard.com/
    This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
    Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
    Benchmarking zeroboard.com (be patient).....done
    Server Software: Apache/2.2.11
    Server Hostname: zeroboard.com
    Server Port: 80
    ocument Path: /
    Document Length: 330 bytes
    Concurrency Level: 10
    Time taken for tests: 0.002 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Non-2xx responses: 1
    Total transferred: 585 bytes
    HTML transferred: 330 bytes
    Requests per second: 500.00 [#/sec] (mean)
    Time per request: 20.00 [ms] (mean)
    Time per request: 2.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 292.50 [Kbytes/sec] received

    (4) -k (keepalive를 활성화) 옵션으로 체크

    [root@qmail bin]# ./ab -k http://zeroboard.com/
    This is ApacheBench, Version 1.3d <$Revision: 1.73 $> apache-1.3
    Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
    Benchmarking zeroboard.com (be patient).....done
    Server Software: Apache/2.2.11
    Server Hostname: zeroboard.com
    Server Port: 80
    Document Path: /
    Document Length: 330 bytes
    Concurrency Level: 1
    Time taken for tests: 0.002 seconds
    Complete requests: 1
    Failed requests: 0
    Broken pipe errors: 0
    Non-2xx responses: 1
    Keep-Alive requests: 0
    Total transferred: 585 bytes
    HTML transferred: 330 bytes
    Requests per second: 500.00 [#/sec] (mean)
    Time per request: 2.00 [ms] (mean)
    Time per request: 2.00 [ms] (mean, across all concurrent requests)
    Transfer rate: 292.50 [Kbytes/sec] received

    (5) -w (테스트 결과를 html으로 저장하기)

    [root@ns1 22:50:09 ~]$ ab -k -w -c 10 -n 1 http://zeroboard.com/ > mysite.bmt.html
    이 명령을 수행하면 zeroboard.com 에 대한 테스트 결과가 mysite.bmt.html 이라는 파일로 저장이 된다.

사이트명 : 기브유넷 | 회사명 : (주)아사달 | 대표이사 : 서창녕 | 대표전화 : 02-2026-2000 | 팩스번호 : 02-2026-2008
사업자등록번호 : 206-81-24351 | 법인등록번호 : 110111-1940504 | 통신판매업신고 : 제18-890호 | 벤처확인번호 : 051134562200563
(우편번호 : 153-803) 서울특별시 금천구 가산동 371-28 우림라이온스밸리 A,동 8층 (주)아사달
Copyright ⓒ giveu.net All rights reserved.
인터넷 익스플로어 구글 크롬 모질라 파이어폭스
애플 사파리 오페라 넷스케이프
맨위로