Re: A couple of questions on apache-fastCGI

Mark Brown (mbrown@openmarket.com)
Thu, 08 Aug 1996 16:31:57 -0400

Message-Id: <199608082031.QAA11163@breckenridge.openmarket.com>
To: fastcgi-developers@openmarket.com
Subject: Re: A couple of questions on apache-fastCGI
In-Reply-To: <31FC8726.51C9F60B@cursci.co.uk>
Date: Thu, 08 Aug 1996 16:31:57 -0400
From: Mark Brown <mbrown@openmarket.com>


Michael Smith asks:

    Can I restart a fastCGI process without killing it?  I know the
    server automatically restarts if it's killed but this means any
    current connections will be terminated.  Is there a way to restart
    after the current connection has been completed.

This can be done with application logic.  The application decides it
needs to be restarted using whatever technique you like: count the
number of requests, poll for the existence of a file, handle a signal,
etc.

You'd call FCGI_FinishRequest near the end of your request loop,
then test for termination, then exit if that's the right
thing to do.  mod_fastcgi will then perform the restart.

    I'm finding it a bit difficult to know how many fastCGI processes
    to run.

For a discussion of tuning the number of processes, see
http://www.fastcgi.com/mail-archive/0120.html.

    I guess what I would like happen is that if a number of requests
    greater than the number of fastCGI processes need to be processed,
    then ordinary CGI will be used instead.

I don't think you'd really want this.  The effect would be to amplify
load spikes; a system running at full capacity would thrash.

Some adaptive tuning of the process pool would be a nice feature to
add to mod_fastcgi, but would need to be approached carefully.

    Is this what happens when listen-queue-depth is exceeded?  If now
    that does this parameter do?

For a description of the listen queue, see the message
cited above, http://www.fastcgi.com/mail-archive/0120.html.

    --mark