I've a Plesk 9.5.4 server on Debian with PHP 5.2.6-1+lenny13, which keeps its php5-cgi process continuously active. I edited the /etc/apache2/conf.d/fcgid.conf and changed the values (and checked if the config was loaded anyway, which was true).

IdleTimeout 500
ProcessLifeTime 360

But still the process keeps alive for over an hour, and there is no activity for longer than half a hour.

Anyone knows what the problem can be?


CGI process are kept "alive" so they can handle requests immediately. They do not terminate after a single request, but are often configured to handle 500-5000 requests until they get replaced with a new one.

The relevant config options are


CGI process management

The web server does not care care itself about handling 50+ PHP-CGI instances that may handle requests, but leaves this job to the CGI server. The CGI server itself keeps a pool of PHP-CGI instances running. It also kills them when they are not needed anymore and starts them when required.

CGI server configuration


tells the CGI process manager how long to wait for the CGI process to return a response.


The web server gets a HTTP request, sends that to the CGI server, CGI server relays that to the PHP-CGI process. Now the PHP-CGI process computes and computes and takes 1 minute to finish. Since the timeout is 120, everything is fine.

Now another request comes in, and the computation is harder, and the PHP-CGI process takes 10 minutes to finish. After 2 minutes, the CGI server reaches the CGI process' idle timeout and decides not to wait any longer. It returns an error to the HTTP server: "no data retrieved, idle timeout".


is the number of seconds that a CGI process may be kept running. After that it's replaced with a new one.

| improve this answer | |
  • Used this in the config : IdleTimeout 500 ProcessLifeTime 360, so normaly they would be killed after 360 seconds – Martijn Bakker Aug 19 '11 at 13:10
  • Yes, this is clear, but the process isn't be replaced, but the process remains for days and longer. – Martijn Bakker Aug 19 '11 at 14:22
  • @Martijn it's probably because of the other settings I mentioned which keep a minimum number of processes around regardless of timeouts. – EightBitTony Aug 19 '11 at 14:47


Check your setting for

-minProcesses n (5) The minimum total number of dynamic FastCGI application instances allowed to run at any one time without being killed off by the process manager (due to lack of demand).

It defaults to 5.


Check your setting for


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. Use FcgidCmdOptions to apply this setting to a single application.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.