Linux ETC

부하 테스트 2편 – Web Test

2012.04.27 08:15

호스트웨이 조회 수:26662

 부하 테스트 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)

요청이 끝나게 되면 위와 같이 요청시간 응답시간등에 대한 리포트가 보여집니다.
결과 처리가 늦어지게 되면 해당 서버의 부하로 인해 문제가 발생 할 수 있으니,
반드시 적은 값부터 조금씩 높혀가며 테스트 해보시기 바랍니다.

번호 제목 글쓴이 날짜 조회 수
306 우분투 기본 쉘 dash 에서 bash로 변경하기 호스트웨이 2015.09.07 10844
305 패스워드 정책 변경 호스트웨이 2015.09.03 3725
304 명령어 dstat 사용하기 호스트웨이 2015.09.01 4370
303 ulimit 설정 관련 호스트웨이 2015.07.29 77646
302 2015년 7월1일 윤초 발생 관련 점검 방안 file 호스트웨이 2015.06.30 1558
301 Sysbench를 통한 System, MySQL 성능 테스트 file 호스트웨이 2015.06.26 9873
300 ngrinder를 이용한 부하 테스트 - 1) Controller 설치 file 호스트웨이 2015.04.08 4285
299 epel-release 설치하기 file 호스트웨이 2014.12.22 14295
298 SVN(subversion) 설치 및 셋팅 file 호스트웨이 2014.12.02 6425
297 리눅스 커널 업데이트 및 커널 변경 부팅 방법 file 호스트웨이 2014.10.30 23430
296 samba 설치 file 호스트웨이 2014.04.14 3378
295 partprobe - 리부팅 없이 사용 중인 파티션 재인식 호스트웨이 2012.12.28 8352
294 오늘 생성한 파일만 조회하기 호스트웨이 2012.12.27 6250
293 sftp 서비스 막기 호스트웨이 2012.12.27 1320
292 리눅스 uniq 명령어 file 호스트웨이 2012.12.27 7878
291 ls -l 출력 시 날짜형태 변경 호스트웨이 2012.12.27 6152
290 리눅스 free 명령어 호스트웨이 2012.12.26 1819
289 리눅스 캐시 메모리 비우기 file 호스트웨이 2012.12.26 5269
288 [ERROR] ftp error 500 OOPS: cannot change directory:/home/ 호스트웨이 2012.12.21 4303
287 free -m 에서 free (남는 메모리 양) 최소량 제한하기 호스트웨이 2012.12.21 2147