ab 프로그램은 웹 서버를 벤치마크하기 위해 Apache 웹 서버와 함께 제공됩니다. Watson™ Explorer Engine은 일반적으로 웹 서버 내에서 CGI 실행 파일로 실행되므로 웹 서버의 작동 성능을 파악하는 것이 유용합니다. ab 애플리케이션은 현재 Apache 설치의 작동 성능에 대한 정보를 제공하도록 설계되었으며, Apache 설치가 서비스할 수 있는 초당 요청 수를 요약해서 보여줍니다.
이 정보는 Watson Explorer Engine이 실행 중인 상태에서 Watson Explorer Engine과 독립적으로 웹 서버에서 처리할 수 있는 최대 로드를 판별하는 데 유용합니다. ab 애플리케이션은 Watson Explorer Engine이 실행 중인 동안 웹 서버를 테스트할 수 있으므로 일반 사용자 관점에서 전체 애플리케이션의 성능에 대한 정확한 벤치마크를 가져올 수 있습니다.
ab 애플리케이션은 Apache 설치 패키지의 일부로 설치됩니다. 대부분의 Linux 배포에서 이 애플리케이션은 httpd-tools 패키지에 포함되어 있습니다. ab유틸리티를 확보하는 방법에 대한 정보는 사용 중인 운영 체제에 대한 Apache 문서를 참조하십시오.
다음은 ab 애플리케이션에서 제공하는 도움말 정보입니다.
# ab -h Usage: ab [options] [http[s]://]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 -b windowsize Size of TCP send/receive buffer, in bytes -p postfile File containing data to POST. Remember also to set -T -u putfile File containing data to PUT. Remember also to set -T -T content-type Content-type header for POSTing, eg. 'application/x-www-form-urlencoded' Default is 'text/plain' -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: gzip' 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 -r Don't exit on socket receive errors. -h Display usage information (this message) -Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers) -f protocol Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL)
Watson Explorer Engine 설치에 대한 로드 테스트 방법의 예제는 다음과 같습니다.
# ab -n 1000 -c 10 http://localhost/velocity/cgi-bin/query-meta 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) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requests Server Software: Apache/2.2.15 Server Hostname: localhost Server Port: 80 Document Path: /velocity/cgi-bin/query-meta Document Length: 140256 bytes Concurrency Level: 10 Time taken for tests: 55.911 seconds Complete requests: 1000 Failed requests: 65 (Connect: 0, Receive: 0, Length: 65, Exceptions: 0) Write errors: 0 Total transferred: 140402934 bytes HTML transferred: 140255934 bytes Requests per second: 17.89 [#/sec] (mean) Time per request: 559.107 [ms] (mean) Time per request: 55.911 [ms] (mean, across all concurrent requests) Transfer rate: 2452.35 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 1 Processing: 366 558 104.9 541 1350 Waiting: 353 528 104.5 511 1320 Total: 366 558 104.9 541 1350 Percentage of the requests served within a certain time (ms) 50% 541 66% 570 75% 593 80% 605 90% 650 95% 701 98% 941 99% 1059 100% 1350 (longest request)
위의 테스트는 이 Watson Explorer Engine 인스턴스를 실행하는 서버가 초당 17.89개의 요청을 처리할 수 있음을 나타냅니다. 이 결과는 query-meta를 실행하고 example-metadata 콜렉션을 검색하는 기본 구성으로 얻은 결과입니다.
meta-searching 및 검색 콜렉션을 사용한 검색에 대한 로드 테스트 출력은 다음과 같습니다.
# ab -n 100 -c 10 "http://localhost/velocity/cgi-bin/query-meta?v:project=query-meta&query=news" 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: 80 Document Path: /velocity/cgi-bin/query-meta?v:project=query-meta&query=news Document Length: 124894 bytes Concurrency Level: 10 Time taken for tests: 70.536 seconds Complete requests: 100 Failed requests: 99 (Connect: 0, Receive: 0, Length: 99, Exceptions: 0) Write errors: 0 Total transferred: 12478129 bytes HTML transferred: 12463429 bytes Requests per second: 1.42 [#/sec] (mean) Time per request: 7053.553 [ms] (mean) Time per request: 705.355 [ms] (mean, across all concurrent requests) Transfer rate: 172.76 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 0 Processing: 2666 6838 1842.3 6547 13812 Waiting: 2650 6822 1842.5 6533 13798 Total: 2666 6838 1842.3 6547 13812 Percentage of the requests served within a certain time (ms) 50% 6547 66% 7243 75% 7676 80% 8149 90% 8995 95% 10025 98% 13689 99% 13812 100% 13812 (longest request)
meta-searching이 조회에 포함되는 경우 성능에 현저한 차이가 있음을 확인할 수 있습니다. 첫 번째 실행은 평균적으로 0.5초에 완료된 총 1000개의 요청(10개 동시)이 있는 검색 콜렉션에 대한 것입니다. 두 번째 실행은 평균적으로 6.5초에 완료된 총 100개의 요청(10개 동시)이 있는 콜렉션 및 연합 소스에 대한 것입니다. 연합을 사용하도록 설정한 후에 10번째 요청의 완료 시간은 13배 더 늘어났습니다.
'APACHE TUNE' 카테고리의 다른 글
How to Install htop on CentOS 7 (0) | 2018.05.05 |
---|---|
How to install Apache Benchmark on CentOS? (0) | 2018.05.05 |
defined (0) | 2018.05.04 |
Apache event MPM, Prefork MPM, Worker MPM 방식의 차이점 및 설치 시 설정 방법 (0) | 2018.05.02 |
WHAT & HOW TO CONFIGURE APACHE MULTI-PROCESSING MODULES (MPMS) (0) | 2018.04.21 |