apache---압력 테스트 도구 ab.exe

2936 단어 apache.
linux 에서 사용
기본 값 은/usr/bin/ab 에 설치 되 어 있 습 니 다.
/usr/bin/ab -n 100 -c 100 http://192.168.4.51/ci/index.php/home/login/index
-n:요청 횟수
-c:동시 다발 수,즉 동시 몇 명 방문
Server Software:        web        
Server Hostname:             
Server Port:                 

Document Path:                 
Document Length:            

Concurrency Level:         
Time taken for tests:            
Complete requests:            
Failed requests:              
Write errors:               
Total transferred:             ,  http     
HTML transferred:       html   ,          
Requests per second:            ,       (  )
Time per request:          ,          
Time per request:                
Transfer rate:                (       )

실례
Server Software:        Apache/2.2.15
Server Hostname:        192.168.4.51
Server Port:            80

Document Path:          /ci/index.php/home/login/index
Document Length:        2079 bytes

Concurrency Level:      100------------------------   
Time taken for tests:   1.636 seconds--------------      
Complete requests:      100------------------------    
Failed requests:        0--------------------------    
Write errors:           0
Total transferred:      246800 bytes
HTML transferred:       207900 bytes
Requests per second:    61.13 [#/sec] (mean)-----------------         
Time per request:       1635.852 [ms] (mean)-----------------100        
Time per request:       16.359 [ms] (mean, across all concurrent requests)----------------1        
Transfer rate:          147.33 [Kbytes/sec] received

기타 주의사항
1)
ab 병발 수 는 요청 수 보다 많 으 면 안 됩 니 다.
ab: Cannot use concurrency level greater than total number of requests
2)
요청 수 는 기본적으로 1024 개 를 초과 할 수 없습니다.
socket: Too many open files (24)
ulimit-n 명령 으로 수정 할 수 있 습 니 다.예 를 들 어 ulimit-n 8192(사용자 가 동시에 열 수 있 는 최대 파일 수 설정).
3)
병발 수 는 기본적으로 20000 개 이상 일 수 없습니다.알려 드 립 니 다.
ab: Invalid Concurrency [Range 0..20000]
apache 소스 코드 support 디 렉 터 리 에서 ab.c 파일 을 수정 해 야 합 니 다.찾 을 수 있 습 니 다:
#define MAX_CONCURRENCY 20000
매크로 정의 값 을 크게 바 꾸 고 apache 를 다시 컴 파일 합 니 다.
4)
제시 하 다.
apr_socket_recv: Connection reset by peer (104)
사실 병발 수가 서버 하드웨어 부 하 를 초과 하면 이 오 류 를 보고 합 니 다.
인터넷 에서 apr-util 에 문제 가 있어 서 불안정 하 다 고 하 는데 몇 번 더 해 보면 돼 요.
5)
그리고 단독 apache bench 소스 패키지 와 ab 튜 토리 얼 을 따로 설치 하 는 방법 도 있 습 니 다.
다운로드:http://apachebench-standalone.googlecode.com/files/ab-standalone-0.1.tar.bz2
설치 튜 토리 얼:https://code.google.com/p/apachebench-standalone/wiki/HowToBuild
6)테스트 중 다음 과 같은 오류 발견
...
Failed requests:        998
   (Connect: 0, Receive: 0, Length: 998, Exceptions: 0)
...
동적 페이지 를 테스트 할 때 되 돌아 오 는 길이 가 처음 과 다 르 기 때문에 ab 는 판단 에 실 패 했 고 동적 페이지 에 대해 합 리 적 입 니 다.참고 가능:http://mib168.iteye.com/blog/1299990

좋은 웹페이지 즐겨찾기