Coolx World - Computer ???
apache internal dummy connection 로그 생성 방지하기 (Linux)
2016-10-27 11:34 - swindler
apache 2.2.x 이후 버전부터 InternalDummyConnection 이 있다.
컨넥션을 준비하기 위해, 로컬접속을 해서 child process를 띄워두는 것이다.

이 때문에 access_log 에 아래와 같은 로그가 주기적으로 생성되는 것을 볼 수 있다.
예)
0 ::1 - - [27/Oct/2016:11:26:04 +0900] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.23 (Amazon) OpenSSL/1.0.1k-fips PHP/5.5.38 (internal dummy connection)"

해당 로그가 방대하게 발생되면, error_log 에 아래와 같은 메세지를 출력하면서 apache 가 정상적으로 응답하지 않는 현상도 발생된다.
예)
FATAL: emalloc(): Unable to allocate 80496387 bytes

아래와 같이 httpd.conf 파일에서 SetEnvIf 를 지정하여 처리할 수 있다.

httpd.conf

SetEnvIf Remote_Addr "::1" loopback
SetEnvIf Remote_Addr "127\.0\.0\.1" loopback
CustomLog logs/access_log combined env=!loopback


Copyright © 1999-2020, swindler.

  2HLAB   2HLAB_Blog   RedToolBox   Omil   Omil_Blog