CB 2.0 with fastcgi

JohnyByk

Verified User
Joined
Mar 7, 2012
Messages
251
After run php script with fastcgi i have a lot of errors in apache logs.

Code:
[Wed Mar 20 08:26:14.985289 2013] [fcgid:warn] [pid 3969:tid 47828724770560] (104)Connection reset by peer: [client 123.125.71.98:48116] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

Code:
[Wed Mar 20 08:11:02.000388 2013] [fcgid:warn] [pid 3856:tid 47139203254016] (9)Bad file descriptor: [client 83.26.153.216:3338] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.traders-co.ru/

Code:
[Tue Mar 19 20:01:13.250010 2013] [fcgid:warn] [pid 6052:tid 47156042962688] (32)Broken pipe: [client 178.183.247.29:49972] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: http://www.traders-co.ru/

My fcgid.conf:
Code:
SharememPath /var/run/fcgid_shm
FcgidMinProcessesPerClass 0
FcgidMaxProcessesPerClass 8
FcgidMaxProcesses 150
FcgidIdleTimeout 60
FcgidProcessLifeTime 120
FcgidIdleScanInterval 30
FcgidPassHeader Authorization
AddHandler fcgid-script .fcgi
FcgidIOTimeout 18000
FcgidBusyTimeout 300
FcgidMaxRequestLen 100000000

Please advise how to resolve this problems.
Regards
 
I think so you can resolve this problem by increase FcgidProcessLifeTime.
It works for me but don't resolve my errors.
 
My fcgid.conf:

<IfModule mod_fcgid.c>
SharememPath /var/run/fcgid_shm
FcgidMinProcessesPerClass 0
FcgidMaxProcessesPerClass 8
FcgidMaxProcesses 150
FcgidIdleTimeout 600
FcgidProcessLifeTime 600
FcgidIdleScanInterval 30
FcgidPassHeader Authorization
AddHandler fcgid-script .fcgi
FcgidIOTimeout 18000
FcgidBusyTimeout 300
FcgidMaxRequestLen 100000000
FcgidIOTimeout 60000
</IfModule>

Get again when i rebuild the indexing in Maganto:

[proxy_fcgi:error] [pid 17310:tid 140058766583552] (70007)The timeout specified has expired: [client xx.xx.xx.xx:60831] AH01075: Error dispatching request to :, referer: http://aquatechnik.hvm05.cows.de/index.php/admin/process/list/key/9c02eb8682b2b8927772ea165261123f/
 
I see so many people have problem with fastcgi.
I am thinking back to suphp + cgi. With fastcgi is too many problems :/
 
I see so many people have problem with fastcgi.

It's a matter of time. We need time to gather enough experience.

By the way, we've been using NGINX+PHP-FPM for 2-3 years on some servers without directadmin. Of course they are set up not the same with those with Directadmin, nevertheless I hardly can recall any serious issue.

So let directadmin staff and forum members to get enough experience, as CB2 is newly released with all of its new features.
 
I know. Fastcgi is not simple in configuration (not only with DA).
Maybe someone know what mean this errors and how resolve problem with them?

Code:
[Mon Mar 25 21:39:02.942726 2013] [fcgid:warn] [pid 7695:tid 47063995602688] (9)Bad file descriptor: [client 89.71.64.112:1129] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

[Mon Mar 25 21:46:47.082663 2013] [fcgid:warn] [pid 7817:tid 47433858705152] (32)Broken pipe: [client 83.4.153.19:4849] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: https://www.google.pl/

I did not find any working solution in google. I don't know what causes the problem. I can't repeat this errors. Appear on different pages and scripts. Pages that show errors with fastcgi not show with suPHP.

When errors appear user see internal server error (500).

Regards
 
It's easy way to install suphp and fastcgi with one php version (5.3) at the same time?

BTW, should I worry about the message?

Code:
Latest version of DirectAdmin: 1.42.1
Installed version of DirectAdmin: 1.43.0

DirectAdmin [B]1.43.0 to 1.42.1[/B] update is available.
 
Last edited:
[..]BTW, should I worry about the message?

Code:
Latest version of DirectAdmin: 1.42.1
Installed version of DirectAdmin: 1.43.0

DirectAdmin [B]1.43.0 to 1.42.1[/B] update is available.

Try ./build update - if that does not help, maybe one of the mirrors is not updated with the new version? If so I would contact DirectAdmin Support.
 
Build update solve the problem. Thanks
It is possible that the DA team will look more closely at the problems with fastcgi.
It seems to me that many users would be satisfied with this reason :)
Fastcgi run faster and work limits to the number of processes.

Regards
 
I know. Fastcgi is not simple in configuration (not only with DA).
Maybe someone know what mean this errors and how resolve problem with them?

Code:
[Mon Mar 25 21:39:02.942726 2013] [fcgid:warn] [pid 7695:tid 47063995602688] (9)Bad file descriptor: [client 89.71.64.112:1129] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

[Mon Mar 25 21:46:47.082663 2013] [fcgid:warn] [pid 7817:tid 47433858705152] (32)Broken pipe: [client 83.4.153.19:4849] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer: https://www.google.pl/

I did not find any working solution in google. I don't know what causes the problem. I can't repeat this errors. Appear on different pages and scripts. Pages that show errors with fastcgi not show with suPHP.

When errors appear user see internal server error (500).

Regards

I have the same issue. PHP running as cgi with mod_fcgid
Code:
[COLOR=#000000][Wed Apr 24 10:47:24.956681 2013] [fcgid:warn] [pid 24096:tid 140694857414400] (104)Connection reset by peer: [client 65.55.213.67:57913] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
anybody has an idea on how to solve this?[/COLOR]
 
I have the same issue. PHP running as cgi with mod_fcgid
Code:
[COLOR=#000000][Wed Apr 24 10:47:24.956681 2013] [fcgid:warn] [pid 24096:tid 140694857414400] (104)Connection reset by peer: [client 65.55.213.67:57913] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function[/COLOR]

anybody has an idea on how to solve this?

We increased some timeout values in httpd-fcgid.conf. Please set your downloadserver to files1 in the options.conf and run:
Code:
./build update
./build rewrite_confs

Please let us know the if you experience the same problem again. Thank you.
 
not sure it helps but on cpanel with fcgid with a specific php app mod_security was causing a Connection reset by peer: error for me.
editing the mod_sec rule (and I forget specifics) + setting a cron to restart fcgid processes (unrelated to this but figured should mention) due to APC fixed my errors, again it was cpanel though.
slim chance thats your issue but thought I would mention.
 
We increased some timeout values in httpd-fcgid.conf. Please set your downloadserver to files1 in the options.conf and run:
Code:
./build update
./build rewrite_confs

Please let us know the if you experience the same problem again. Thank you.

Hello smtalk,

Yes, the problem is still present...

Code:
[COLOR=#000000][proxy_fcgi:error] [pid 10831:tid 140385678477056] (70007)The timeout specified has expired: [client xxx.xxx.xxx.xxx:61773] AH01075: Error dispatching request to :, referer: http://xxx.xxx.xxx.xxx/phpmyadmin/[/COLOR]


Apache 2.4.4
PHP 5.4.15 PHP-FPM

Code:
<IfModule mod_fcgid.c>  SharememPath /var/run/fcgid_shm
  FcgidMinProcessesPerClass 0
  FcgidMaxProcessesPerClass 8
  FcgidMaxProcesses 150
  FcgidIdleTimeout 60
  FcgidProcessLifeTime 120
  FcgidIdleScanInterval 30
  FcgidBusyTimeout 3600
  FcgidIOTimeout    600
  FcgidMaxRequestLen 1073741824
  FcgidPassHeader Authorization
  AddHandler fcgid-script .fcgi
</IfModule>

EDIT: Change PHP-FPM to FastCGI and same problem with any php script every 30 seconds
 
Last edited:
Solution?

Hello, any effective solution to increase the timeout more than 30 seconds?

Code:
[root@server ~]# /usr/local/directadmin/directadmin o
Compiled on 'CentOS 6.0 64-Bit'
Compile time: Jun 11 2013 at 16:24:50
Compiled with IPv6

CB 2.0.0-RC4
Apache 2.4.4
PHP-FPM 5.4.16

With any script more than 30 seconds (sleep(35);) always shows Error. Ignores timeout settings.

Code:
[Sat Jun 22 15:52:36.180110 2013] [proxy_fcgi:error] [pid 1083:tid 140434969855744] (70007)The timeout specified has expired: [client *.*.*.*:50449] AH01075: Error dispatching request to :, referer: http://*.com/

Thank
 
:)

Ok I have solved this by modifying a line in the file "mod_proxy_fcgi.c":

# tar xzvf httpd-2.4.4.tar.gz
# nano /usr/local/directadmin/custombuild/httpd-2.4.4/modules/proxy/mod_proxy_fcgi.c
Code:
[COLOR=#000000][FONT=Consolas]timeout = apr_time_from_sec(30);[/FONT][/COLOR]

to
Code:
[COLOR=#000000][FONT=Consolas]timeout = apr_time_from_sec(600);[/FONT][/COLOR]

# rm httpd-2.4.4.tar.gz
# tar czvf httpd-2.4.4.tar.gz httpd-2.4.4
# md5sum httpd-2.4.4.tar.gz
# nano versions.txt
Code:
apache2.4:2.4.4:NEW_MD5
# nano /usr/local/directadmin/data/templates/php-fpm.conf
Code:
request_terminate_timeout = 30s
to
Code:
request_terminate_timeout = 600s
# ./build apache

...and now i can run php scripts more than 30 seconds.

Surely this can be done in a simpler way.

Hope Smtalk can give us in future versions of CB2 the selecting timeout option we want in the options.conf file.

Very thank Martynas for his work on CB.
 
Last edited:
request_terminate_timeout should be removed at all from the future versions of DA (it defaults to 0 (unlimited) now, earlier default was 5s). About the mod_proxy_fcgi.c patch, we'll likely not include it, because apache developers haven't fixed their bugs for almost 6 months, that's why we are planning to switch back to mod_fastcgi again. We have the environment ready on our testboxes and it seems to run fine there (CustomBuild 2.0 RC5 and DA 1.43.1), they should be released to public soon. Thank you for your suggestions.
 
Thanks for the advice Martynas,

I updated CB2 to Version: 2.0.0-RC5.

Updated DA to last pre-release:
Compiled on 'CentOS 6.0 64-Bit'
Compile time: Jun 23 2013 at 01:17:14
Compiled with IPv6,

Changed php 5.4 and 5.3 to fastcgi mode, build apache, build php and rewrite_confs...

everything perfect for now, no timeout problems.


It is a pity that they have abandoned the php-fpm project.

Thank you for your work and help
 
Back
Top