2012.04.27 08:15
부하 테스트 2편 – Web Test
이번엔 하드웨어 스트레스 툴에 이어 웹 테스트 툴인 ab를 소개해 드립니다.
시스템 리소스 사용량이 아닌 웹 접속을 얼마나 받아들일 수 있는지 등의 테스트로
최대 가능한 수용 범위를 추정해볼 수 있습니다.
CPU의 처리능력과 메모리의 보조역할 HDD의 I/O 응답 속도들이 뒷받침 되어야 더 많은
양의 동시접속자도 감당할 수 있을 것입니다.
물론 잘 아실테지만, CPU와 Memory의 영향이 큽니다. 이미지 서버와 같은 경우는 하드 속도의
영향도 무시할 수 없습니다.
하여 서버에 맞는 최대치를 설정 해주어야 서버가 다운되는 현상을 방지 할 수 있습니다.
[유용한 옵션]
-n requests
Number of requests to perform for the benchmarking session.
The default is to just perform a single request which usually leads to non-representative
benchmarking results.
요청을 수행할 개수
-c concurrency
Number of multiple requests to perform at a time. Default is one request at a time.
요청을 만들 개수로 동시 사용자 개념
-v verbosity
Set verbosity level - 4 and above prints information on headers, 3 and above
printsresponse codes (404, 200, etc.), 2 and above prints warnings and info.
얼마나 자세한 정보를 화면에 출력해 줄 것인지 결정
-w HTML
Print out results in HTML tables. Default table is two columns wide, with a white background.
문서형식으로 테이블로 만들어 결과를 화면에 출력
-k HTTP
Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session.
Default is no KeepAlive.
프로토콜의 지속연결 (KeepAlive) 기능을 사용
[사용 예제]
형식 : ab –n 시도횟수 –c 동시접속수 http://도메인:포트번호/
# ab -n 100 -c 30 http://www.test.com:80/
[root@manage ~]# ab -n 100 -c 30 http://test.com:80/
30명의 동시접속자가 test.com으로 100번 접속 시도 진행.
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking test.com (be patient)...
..done
Server Software: Apache/2.4.1
Server Hostname: test.com
Server Port: 80
Document Path: /
Document Length: 10069 bytes
Concurrency Level: 30
Time taken for tests: 48.894663 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1030700 bytes
HTML transferred: 1006900 bytes
Requests per second: 2.05 [#/sec] (mean)
Time per request: 14668.399 [ms] (mean)
Time per request: 488.947 [ms] (mean, across all concurrent requests)
Transfer rate: 20.57 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.7 0 2
Processing: 1642 14334 13652.5 6943 41160
Waiting: 1348 13893 13308.1 6853 40811
Total: 1642 14334 13652.8 6943 41162
Percentage of the requests served within a certain time (ms)
50% 6943
66% 10805
75% 31599
80% 34003
90% 36132
95% 37108
98% 41035
99% 41162
100% 41162 (longest request)
요청이 끝나게 되면 위와 같이 요청시간 응답시간등에 대한 리포트가 보여집니다.
결과 처리가 늦어지게 되면 해당 서버의 부하로 인해 문제가 발생 할 수 있으니,
반드시 적은 값부터 조금씩 높혀가며 테스트 해보시기 바랍니다.
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
106 | rsync / 파티션 전체 동기화 방법 | 호스트웨이 | 2012.12.14 | 2429 |
105 | 특정 파일이 소속된 rpm 패키지 찾기 | 호스트웨이 | 2012.12.14 | 1783 |
104 | df 와 du의 출력 크기가 다르게 보이는 이유 | 호스트웨이 | 2012.12.14 | 4435 |
103 | nl명령어를 사용해 파일내용 출력시 행번호 붙이기 | 호스트웨이 | 2012.12.20 | 3933 |
102 | df 쉽게 보기 | 호스트웨이 | 2012.12.20 | 2835 |
101 | 쉘 프롬프트에서 바로 이전 디렉토리로 이동하기 | 호스트웨이 | 2012.12.20 | 2751 |
100 | free -m 에서 free (남는 메모리 양) 최소량 제한하기 | 호스트웨이 | 2012.12.21 | 2149 |
99 | [ERROR] ftp error 500 OOPS: cannot change directory:/home/ | 호스트웨이 | 2012.12.21 | 4307 |
98 | 리눅스 캐시 메모리 비우기 | 호스트웨이 | 2012.12.26 | 5269 |
97 | 리눅스 free 명령어 | 호스트웨이 | 2012.12.26 | 1819 |
96 | ls -l 출력 시 날짜형태 변경 | 호스트웨이 | 2012.12.27 | 6162 |
95 | 리눅스 uniq 명령어 | 호스트웨이 | 2012.12.27 | 7880 |
94 | sftp 서비스 막기 | 호스트웨이 | 2012.12.27 | 1321 |
93 | 오늘 생성한 파일만 조회하기 | 호스트웨이 | 2012.12.27 | 6266 |
92 | partprobe - 리부팅 없이 사용 중인 파티션 재인식 | 호스트웨이 | 2012.12.28 | 8362 |
91 | samba 설치 | 호스트웨이 | 2014.04.14 | 3380 |
90 | 리눅스 커널 업데이트 및 커널 변경 부팅 방법 | 호스트웨이 | 2014.10.30 | 23457 |
89 | SVN(subversion) 설치 및 셋팅 | 호스트웨이 | 2014.12.02 | 6426 |
88 | epel-release 설치하기 | 호스트웨이 | 2014.12.22 | 14299 |
87 | ngrinder를 이용한 부하 테스트 - 1) Controller 설치 | 호스트웨이 | 2015.04.08 | 4287 |