Home
home
🏡 홈
home

아파치 부하 발생 테스트 (아차피벤치, ApacheBench)

분류
태그
작성자
작성일
2024/09/30 00:53

Ubuntu Version : 22.0.4 SERVER LTS

# 아파치2 유틸 설치 apt-get install apache2-utils
Shell
복사

 명령어

$ ab ab: wrong number of arguments 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 at a time -t timelimit Seconds to max. to spend on benchmarking This implies -n 50000 -s timeout Seconds to max. wait for each response Default is 30 seconds -b windowsize Size of TCP send/receive buffer, in bytes -B address Address to bind to when making outgoing connections -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 to use for POST/PUT data, 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. -q Do not show progress when doing more than 150 requests -l Accept variable document length (use this for dynamic pages) -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. -m method Method name -h Display usage information (this message) -I Disable TLS Server Name Indication (SNI) extension -Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers) -f protocol Specify SSL/TLS protocol (SSL2, TLS1, TLS1.1, TLS1.2 or ALL)
Shell
복사

 테스트 케이스 1 ) 400개의 요청, 동시 접속 1

$ ab -n 400 -c 1 http://3.34.126.75/ This is ApacheBench, Version 2.3 <$Revision: 1807734 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 3.34.126.75 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Finished 400 requests Server Software: Apache Server Hostname: 3.34.126.75 Server Port: 80 Document Path: / Document Length: 27421 bytes Concurrency Level: 1 Time taken for tests: 10.696 seconds Complete requests: 400 Failed requests: 0 Total transferred: 11120400 bytes HTML transferred: 10968400 bytes Requests per second: 37.40 [#/sec] (mean) Time per request: 26.740 [ms] (mean) Time per request: 26.740 [ms] (mean, across all concurrent requests) Transfer rate: 1015.32 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 1 Processing: 24 26 0.9 26 37 Waiting: 24 26 0.9 26 35 Total: 24 27 1.0 27 38 Percentage of the requests served within a certain time (ms) 50% 27 66% 27 75% 27 80% 27 90% 27 95% 28 98% 29 99% 30 100% 38 (longest request)
Shell
복사

 테스트 케이스 1 ) 400개의 요청, 동시 접속 100

$ ab -n 400 -c 100 http://3.34.126.75/ This is ApacheBench, Version 2.3 <$Revision: 1807734 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 3.34.126.75 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Finished 400 requests Server Software: Apache Server Hostname: 3.34.126.75 Server Port: 80 Document Path: / Document Length: 27421 bytes Concurrency Level: 100 Time taken for tests: 10.112 seconds Complete requests: 400 Failed requests: 0 Total transferred: 11120400 bytes HTML transferred: 10968400 bytes Requests per second: 39.56 [#/sec] (mean) Time per request: 2527.892 [ms] (mean) Time per request: 25.279 [ms] (mean, across all concurrent requests) Transfer rate: 1073.99 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 1.0 0 5 Processing: 127 2237 595.1 2474 2768 Waiting: 127 2236 595.1 2473 2767 Total: 129 2237 594.4 2474 2770 WARNING: The median and mean for the initial connection time are not within a normal deviation These results are probably not that reliable. Percentage of the requests served within a certain time (ms) 50% 2474 66% 2489 75% 2502 80% 2533 90% 2589 95% 2621 98% 2646 99% 2690 100% 2770 (longest request)
Shell
복사

 출처