apr_socket_recv: peer 오류 로 연결 재 설정

2426 단어 SHELLLinuxWEB
ab 로 성능 테스트.
동시 요 구 량 이 조금 높 으 면 (200, 300 이상) aprsocket_recv: Connection reset by peer 의 잘못.
처음에는 apache 서버 설정 에 문제 가 있다 고 생각 했 습 니 다. 인터넷 에서 찾 아 보 니 당신 도 알 고 있 었 습 니 다. 우리 나라 의 특수 한 국정 관례 에 따라 모두 같은 글 을 시험 해 보 았 습 니 다.
마지막 으로 믿 을 만 한 해결 방법 을 찾 았 다.
같은 문제 가 있 으 면 주저 하지 마 세 요. ab 는 다시 컴 파일 하여 설치 해 야 합 니 다. yum 으로 httpd 를 설치 하 는 것 도 예외 가 아 닙 니 다. ab 와 apr 를 새로 컴 파일 하여 설치 해 야 합 니 다.
만약 당신 이 컴 파일 을 통 해 설 치 된 ab. c 파일 을 수정 한 후에 다시 컴 파일 하여 설치 하 는 것 도 같은 문제 가 있다 면 apr 의 문제 라 고 생각 합 니 다.
구체 적 인 잘못 은 어디 에 도 연구 되 지 않 았 다. 다음 방법 으로 이 문 제 를 해결 할 수 있다.
1. 필요 한 소스 코드 다운로드
apr 와 apr - utils
http://apr.apache.org/download.cgi 
ab 원본 은 여기 서 다운로드 할 수 있 습 니 다.
https://code.google.com/p/apachebench-standalone/downloads/list
2. 컴 파일 설치
$ mkdir ab
$ mkdir apr
$ mkdir apr-utils

$ cd ab
$ wget https://apachebench-standalone.googlecode.com/files/ab-standalone-0.1.tar.bz2
$ tar -xvf ab-standalone-0.1.tar.bz2
$ cd ../apr
$ wget http://apache.etoak.com//apr/apr-1.4.8.tar.gz
$ tar -xvf apr-1.4.8.tar.gz
$ cd ../apr-utils
$ wget http://apache.etoak.com//apr/apr-util-1.5.2.tar.gz
$ tar -xvf apr-util-1.5.2.tar.gz

apr 먼저 컴 파일 하기
$ cd apr/apr-1.4.8
$ ./configure
$ make
$ make install

컴 파일 apr - utils
$ cd apr-utils/apr-util-1.5.2
$ ./configure --with-apr=/usr/local/apr
$ make
$ make install

컴 파일 ab
ab. c 파일 수정
$ cd ab/ab-standalone
$ vim ab.c

도착: 1380 줄
다음 과 같이 수정 합 니 다.
        /* catch legitimate fatal apr_socket_recv errors */
        else if (status != APR_SUCCESS) {
            err_recv++;
            if (recverrok) {
                bad++;
                close_connection(c);
                if (verbosity >= 1) {
                    char buf[120];
                    fprintf(stderr,"%s: %s (%d)
", "apr_socket_recv", apr_strerror(status, buf, sizeof buf), status); } return; } else { //apr_err("apr_socket_recv", status); // 从这开始 bad++; close_connection(c); return; // 到这里 } }

고 친 후
$ make apr-skeleton
$ make ab
됐 습 니 다.
이전 ab 를 소프트 연결 로 바 꾸 거나 컴 파일 된 디 렉 터 리 에 직접 사용 하 셔 도 됩 니 다.
레 퍼 런 스
https://code.google.com/p/apachebench-standalone/wiki/HowToBuild

좋은 웹페이지 즐겨찾기