Temporarily website outages, fastcgi PHP communication aborted

apache-2.4fastcgioutagephp-fpmphp5

I've noticed that my web server has occasional 1-5 minute outages every day.
I've checked the Apache error log and found the following:

[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"

I've looked in the syslog and php5-fpm.log but couldn't find any errors.

in my php.ini I had set: error_log = /var/log/php_errors.log
But this file is not being generated, while log_errors is turned to on.

I've also tried setting error_log = syslog
But no errors are being reported in the syslog regarding PHP.

Any idea what I can do to resolve this problem?
I'm using Ubuntu server 15.04 x64, Apache 2.4.10, PHP-FPM 5.6

Best Answer

Please check for error in /var/log/messages file, there you can find server related error.

Is it happening at particular time everyday then you may like to look for cron process which is running at that time and causing issue.

You need to check server load at that time and if server load is increasing at that time then you need to check for process causing server load.