Stuff…

I know I will forget.

Stuff… header image 2

mod_fcgid ap_pass_brigade failed and premature end of script headers

April 12th, 2010 · 4 Comments

OS: CentOS 5.4
Control Panel: 9.3

Was getting errors from a PHP script when it was trying to run a long task (over 60 seconds) under mod_fcgid distributed with Plesk.

The errors we saw were:

[Mon Apr 12 15:40:56 2010] [warn] (103)Software caused connection abort: mod_fcgid: ap_pass_brigade failed in handle_request function
[Mon Apr 12 16:28:31 2010] [error] [client 1.1.1.1] Premature end of script headers: count.php

To test this we had a little script to count up to X number of seconds:

<html>
<body>
<?php
$i=1;
$time = 50;

while ($i<$time) {
echo $i.’ seconds: ‘.date(‘h:i:s’) . “<br />”;
sleep(1);
$i++;
}
?>
</body>
</html>

We tried updating the vhost.conf file with the following settings and reconfigured the webserver, but, it still didn’t change the time it too for the error to occur:

# vhost.conf Plesk file
# Trying to get it to error faster….
ProcessLifeTime 5
IPCCommTimeout 5
IPCConnectTimeout 5

/usr/local/psa/admin/bin/websrvmng –reconfigure-vhost –vhost-name=domain.com

This did not work.  Eventually we ended up putting the same contents into vhost.conf AND vhost_ssl.conf which appears to have worked.  The values we ended up putting in both files were:

<IfModule mod_fcgid.c>
# Sane place to put sockets
SocketPath /var/lib/httpd/fcgid/sock
IdleTimeout 3600
ProcessLifeTime 7200
MaxProcessCount 1000
DefaultMinClassProcessCount 3
DefaultMaxClassProcessCount 100
IPCConnectTimeout 8
IPCCommTimeout 600
BusyTimeout 300
</IfModule>

Our scripts ran fine after this.  Another solution was to edit the /etc/httpd/conf.d/fcgid.conf file directly, but, that updated the values for all sites and we only wanted one.

URLs:

Tags: Control Panels · Linux · Operating System

4 responses so far ↓

  • 1 pg // Oct 14, 2010 at 12:24 am

    Looks like you need to look at your Xcache setup, it’s throwing errors everywhere on your site re: var data caching

  • 2 pg // Oct 14, 2010 at 12:24 am

    Looks like you need to look at your Xcache setup, it’s throwing errors everywhere on your site re: var data caching

    Warning: xcache_set() [function.xcache-set]: xcache.var_size is either 0 or too small to enable var data caching in /home/www/www.moe.co.uk/httpdocs/wp-content/plugins/w3-total-cache/lib/W3/Cache/Xcache.php on line 40

  • 3 admin // Oct 21, 2010 at 2:34 pm

    Thanks Chris. That started happening after installing W3 Total Cache. Sorted it the other day, thanks again.

  • 4 jgomsi // Nov 25, 2010 at 1:13 pm

    Thank you for this article! The little script help me to reproduce and debug the error: after a couple of weeks running ok with a custom vhost.conf, Plesk decided to ignore it… I just had to “websrvmng –reconfigure-vhost” to make it work again.

Leave a Comment