Problems with apache mod_fcgid

I have a problem on multiple servers than using the Apache mod_fcgid module to serve a cgi script that processes the request (document check and similar processing) and then serves the files on the server based on the processing result.

I keep repeating the following errors in the logs:

[Mon Jan 30 23:11:41 2012] [warn] [client 95.35.160.193] mod_fcgid: error reading data, FastCGI server closed connection [Mon Jan 30 23:11:41 2012] [warn] [client 95.35.160.193] (32)Broken pipe: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function [Mon Jan 30 23:13:34 2012] [warn] [client 37.8.52.128] mod_fcgid: can't apply process slot for /var/www/cgi-bin/assetx.fcgi 

These problems cause the server to run slowly, and in other cases lead to temporary unavailability of the service.

Servers have a lot of traffic on them, I have currently configured the following fcgi directives, as shown below:

 FcgidMaxRequestsPerProcess 0 FcgidMaxProcesses 300 FcgidMinProcessesPerClass 0 FcgidIdleTimeout 240 FcgidIOTimeout 240 FcgidBusyTimeout 300 

the average load on the servers is normal; the average number of processes is 250 processes.

I did research for several days about this problem, some say that this is a resolution problem, I followed their suggestion, did not help. I tried setting the parameters above, these are the final values ​​that I tried, but they did not work. I am also trying to use nginx instead of apache, but I cannot find a suitable way to run a cgi script with this high load on the server using nginx.

What can I do to fix this problem?

+4
source share
1 answer

Your application dies before Apache can contact it successfully. The answer is to find out why the application is dying.

The FastCGI process should never die or quit, even in the event of an error. Apache expects the FastCGI script to just stay there.

You mentioned that you have a cgi script. How did you change it to support FastCGI?

Usually you need to switch to something like CGI :: Fast, delete all calls to die and exit, and rearrange your script to run using the CGI :: Fast while loop.

+1
source

Source: https://habr.com/ru/post/1393859/


All Articles