logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Better mod_fcgid configuration
Author
bagu



Joined: 06 Jan 2011
Posts: 187
Location: France

PostPosted: Tue 02 Jul '19 23:53    Post subject: Better mod_fcgid configuration Reply with quote

Hello,

Since a while, i have many timeout and zombie process with fcgid.
So, i wonder how i can set up a better config file for fcgid.

Here is my config file :
Code:
FcgidInitialEnv PHPRC "d:\\wamp\\php"
FcgidInitialEnv PATH "d:\\wamp\\php;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;"
FcgidInitialEnv SystemRoot "C:\\Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "X:\\Temp"
FcgidInitialEnv TMP "X:\\Temp"
FcgidInitialEnv windir "C:\\Windows"

#   FcgidIOTimeout seconds (40)
#   This is the maximum period of time the module will wait while trying to read from or write to a FastCGI application.
FcgidIOTimeout 40

#   FcgidConnectTimeout seconds (3)
#   This is the maximum period of time the module will wait while trying to connect to a FastCGI application on Windows. (This directive is not respected on Unix, where AF_UNIX defaults will apply.)
FcgidConnectTimeout 3

#   FcgidMaxProcesses value (1000)
#   This directive sets the maximum number of FastCGI application processes which can be active at one time.
FcgidMaxProcesses 1000

#   FcgidMaxProcessesPerClass (100)
#   This directive sets the maximum number of processes that can be started for each process class.
FcgidMaxProcessesPerClass 100

#   FcgidProcessLifeTime seconds (3600)
#   Idle application processes which have existed for greater than this time will be terminated, if the number of processses for the class exceeds FcgidMinProcessesPerClass.
#   A value of 0 disables the check.
FcgidProcessLifeTime 0

#   ZombieScanInterval n (3 seconds)
#   The scan interval for zombie process.
FcgidZombieScanInterval 3

#   FcgidMaxRequestsPerProcess value (0)
#   FastCGI application processes will be terminated after handling the specified number of requests.
#   A value of 0 disables the check.
FcgidMaxRequestsPerProcess 0

#   FcgidMinProcessesPerClass value (3)
#   This directive sets the minimum number of processes that will be retained in a process class after finishing requests.
#   This setting will apply to all applications spawned for this server or virtual host.
#   FcgidMinProcessesPerClass 0
FcgidMinProcessesPerClass 0

#   FcgidFixPathinfo 1-0 (0)
#   This directive enables special SCRIPT_NAME processing which allows PHP to provide additional path information. The setting of FcgidFixPathinfo should mirror the cgi.fix_pathinfo setting in php.ini
FcgidFixPathinfo 0

#   FcgidMaxRequestInMem bytes (65536)
#   This module reads the entire request body from the client before sending it to the application.
#   Normally the request body will be stored in memory. Once the amount of request body read from the client exceeds FcgidMaxRequestInMem bytes, the remainder of the request body will be stored in a temporary file.
FcgidMaxRequestInMem 16777216

#   FcgidOutputBufferSize (65536)
#   This is the maximum amount of response data the module will read from the FastCGI application before flushing the data to the client.
FcgidOutputBufferSize 1073741824

#   FcgidMaxRequestLen bytes (131072)
#   If the size of the request body exceeds this amount, the request will fail with 500 Server Error.
FcgidMaxRequestLen 1073741824

#   FcgidConnectTimeout n (3 seconds)
#   The connect timeout to a fastcgi application.
FcgidConnectTimeout 3

#   FcgidIOTimeout n (40 seconds)
#   This is the maximum period of time the module will wait while trying to read from or write to a FastCGI application.
#   Please increase this value if your CGI have a slow initialization or slow respond.
FcgidIOTimeout 40

#   FcgidWin32PreventOrphans On|Off
FcgidWin32PreventOrphans On

<Files ~ "\.php$">
   Options Indexes FollowSymLinks ExecCGI
   AddHandler fcgid-script .php
   FcgidWrapper "d:/wamp/php/php-cgi.exe" .php
</Files>


Error messages or warn are like these :
Code:
mod_fcgid: cleanup zombie process 11996

Code:
mod_fcgid: read timeout from pipe

Code:
End of script output before headers


Thanks for your help
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 30 Jul '19 8:51    Post subject: Re: Better mod_fcgid configuration Reply with quote

bagu wrote:


Error messages or warn are like these :
Code:
mod_fcgid: cleanup zombie process 11996

Code:
mod_fcgid: read timeout from pipe

Code:
End of script output before headers




Hui Bagu,
the first message is not so much to worry about. That should be more or less an info in the error log and not a warning.

The second one is linked to FcgidIOTimeout and or FcgidBusyTimeout that comes from the max_execution_time in PHP. So the script runs longer than the Fcgid values.

The last warning is about a 500 error. Most likely that the PHP script throws an exception. Often helpful is to use log_errors and error_log (see php.ini) to track those errors.
Back to top
bagu



Joined: 06 Jan 2011
Posts: 187
Location: France

PostPosted: Tue 30 Jul '19 11:46    Post subject: Reply with quote

Hi,

1-I wonder if there is a way to avoid cleanup zombie process

2-Ok, but FcgidIOTimeout and FcgidBusyTimeout have the same value that max_execution_time in php.ini so, it's a bit strange

3-There is only one error message in logs PHP Fatal error: Uncaught Error: Call to a member function unreadCount() on bool in ***\index.php:90 that come from leed RSS. But i already try to ask leed dev for this error without success. Maybe i must search for an other RSS reader Wink

Thanks
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 30 Jul '19 12:59    Post subject: Reply with quote

bagu wrote:

1-I wonder if there is a way to avoid cleanup zombie process

Solve Problem number two.


bagu wrote:

2-Ok, but FcgidIOTimeout and FcgidBusyTimeout have the same value that max_execution_time in php.ini so, it's a bit strange


Nope, not strange. The IO time needs to be a bit higher than the PHP time. If the PHP process runs for 40 seconds and the IO max waiting time is 40 seconds then the fcgid process exists at the same time like the PHP process and can't receive the data (including the PHP error message that the script ran for too long).
Back to top
bagu



Joined: 06 Jan 2011
Posts: 187
Location: France

PostPosted: Tue 30 Jul '19 18:27    Post subject: Reply with quote

Ok, I thought you had to put the same value between fcgid and php.
I will try to increase these values.


Thanks
Back to top


Reply to topic   Topic: Better mod_fcgid configuration View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules