
내 웹 서버가 매일 1~5분씩 중단되는 것을 발견했습니다. Apache 오류 로그를 확인한 결과 다음을 발견했습니다.
[Sun May 10 14:13:19.299784 2015] [fastcgi:error] [pid 2599:tid 139669761148672] [client 174.34.156.130:13278] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Sun May 10 14:13:19.299855 2015] [fastcgi:error] [pid 2599:tid 139669761148672] [client 174.34.156.130:13278] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
[Sun May 10 14:14:00.782370 2015] [fastcgi:error] [pid 2473:tid 139669735970560] [client 82.103.128.63:45704] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Sun May 10 14:14:00.782432 2015] [fastcgi:error] [pid 2473:tid 139669735970560] [client 82.103.128.63:45704] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
[Sun May 10 14:14:19.124915 2015] [fastcgi:error] [pid 2473:tid 139669786326784] [client 188.138.118.184:34672] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Sun May 10 14:14:19.124962 2015] [fastcgi:error] [pid 2473:tid 139669786326784] [client 188.138.118.184:34672] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
[Sun May 10 14:14:33.978792 2015] [fastcgi:error] [pid 2473:tid 139669643650816] [client 82.103.128.63:11778] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Sun May 10 14:14:33.978853 2015] [fastcgi:error] [pid 2473:tid 139669643650816] [client 82.103.128.63:11778] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
[Sun May 10 14:14:34.380783 2015] [fastcgi:error] [pid 2598:tid 139669744363264] [client 174.34.156.130:46479] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Sun May 10 14:14:34.380843 2015] [fastcgi:error] [pid 2598:tid 139669744363264] [client 174.34.156.130:46479] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
[Sun May 10 14:15:19.518501 2015] [fastcgi:error] [pid 2598:tid 139669685614336] [client 76.164.194.74:28967] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Sun May 10 14:15:19.518575 2015] [fastcgi:error] [pid 2598:tid 139669685614336] [client 76.164.194.74:28967] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
[Sun May 10 14:16:19.404843 2015] [fastcgi:error] [pid 2598:tid 139669727577856] [client 50.23.94.74:23923] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Sun May 10 14:16:19.404894 2015] [fastcgi:error] [pid 2598:tid 139669727577856] [client 50.23.94.74:23923] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
[Sun May 10 14:17:19.210294 2015] [fastcgi:error] [pid 2598:tid 139669769541376] [client 85.17.156.99:15068] FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
[Sun May 10 14:17:19.210368 2015] [fastcgi:error] [pid 2598:tid 139669769541376] [client 85.17.156.99:15068] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php5-fcgi"
syslog와 php5-fpm.log를 살펴봤지만 오류를 찾을 수 없습니다.
내 php.ini에 다음과 같이 설정했습니다: error_log = /var/log/php_errors.log 그러나 이 파일은 log_errors가 켜져 있는 동안에는 생성되지 않습니다.
나는 또한 error_log = syslog 설정을 시도했지만 PHP와 관련된 syslog에는 오류가 보고되지 않았습니다.
이 문제를 해결하기 위해 무엇을 할 수 있는지 아시나요? 저는 Ubuntu 서버 15.04 x64, Apache 2.4.10, PHP-FPM 5.6을 사용하고 있습니다.
답변1
/var/log/messages 파일에서 오류를 확인하세요. 거기에서 서버 관련 오류를 찾을 수 있습니다.
매일 특정 시간에 발생한다면 해당 시간에 실행되어 문제를 일으키는 cron 프로세스를 찾고 싶을 수도 있습니다.
이때 서버 부하를 확인해야 하며, 이때 서버 부하가 증가하고 있다면 서버 부하를 유발하는 프로세스가 있는지 확인해야 합니다.
답변2
블록 에 다음 지시문을 설정해 보세요 <VirtualHost>
.
FcgidMaxRequestsPerProcess 1000
FcgidIOTimeout 3600
FcgidConnectTimeout 3600
FcgidIdleTimeout 3600
FcgidProcessLifeTime 3600
FcgidBusyTimeout 3600
RAM 사용량을 주의 깊게 살펴보세요. 이것이 효과가 있으면 이를 줄이고 다시 테스트할 수 있습니다.