Recycling FastCGI processes

Rujith S. de Silva (
Tue, 04 Jun 1996 08:32:34 -0400

Message-Id: <>
Date: Tue, 04 Jun 1996 08:32:34 -0400
From: "Rujith S. de Silva" <>
Subject: Recycling FastCGI processes

For various reasons, such as a small memory leak, one might wish to have
a FastCGI process handle (say) a thousand requests, and then gracefully
exit, so that the server would restart it.  Can this be done?  Can this
be done in Perl?  I tried:

while ($count < $num_hits && FCGI::accept >= 0)
    handle_request ();
exit (0);

But it seems that the LAST request handled before the exit gets munged.
In hindsight, this was to be expected.  I tried messing with
FCGI::set_exit_status () to no avail.

So I guess my question is: how does one tell the FCGI libs that one has
finished processing the current request, but does NOT want to handle
another request?