PHP and Mod_Fcgid: Ap_Pass_Brigade Failed in Handle_Request_Ipc Function

PHP and mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

The warning has nothing to do with any of the Fcgidxxx options and is simply caused by client's closing their side of the connection before the server gets a chance to respond.

From the actual source:

/* Now pass any remaining response body data to output filters */
if ((rv = ap_pass_brigade(r->output_filters, brigade_stdout)) != APR_SUCCESS) {
if (!APR_STATUS_IS_ECONNABORTED(rv)) {
ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r,
"mod_fcgid: ap_pass_brigade failed in "
"handle_request_ipc function");
}

return HTTP_INTERNAL_SERVER_ERROR;
}

Credit goes to Avian's Blog who found out about it.

mod_fcgid: ap_pass_brigade failed in handle_request function

By default FastCGI processes exit after 500 requests. You can either raise PHP_FCGI_MAX_REQUESTS (in the wrapper) or limit FcgidMaxRequestsPerProcess to 500.

See http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#examples "Special PHP considerations"

mod_fcgid + PHP + apache lockup

I managed to fix this one myself.

To solve this problem add in stricter checks in the FastCGI configuration for process hangs, and reduce the lifetime of your PHP instances:

IPCConnectTimeout 20
ProcessLifeTime 120
IdleTimeout 60
IdleScanInterval 30
MaxRequestsPerProcess 499
MaxProcessCount 100

Depending on your requirements, this can satisfy a well-configured server that has in excess of 50k hits per hour.

You will find the number of recorded defunct / "zombie" PHP processes increases significantly. This is good, however, as previously the processes would have simply become unresponsive and the FastCGI manager would have continued to pipe requests to them!

I would also advise removing all override directives from your php.fcgi script, as this can cause problems with your system. Try to manage as much as possible from the primary FastCGI configuration in Apache.

(70007)The timeout specified has expired: mod_fcgid: can't get data from http client

You will need change few things in your php.ini file

  1. max_execution_time = 1500; or more as per your need
  2. max_input_time = 1500; or more as per your need
  3. post_max_size = 500M; or more as per your need


Related Topics



Leave a reply



Submit