Patrick Walsh/VGI (Patrick_Walsh@vanguard.com)
20 May 96 13:42:14 EST

Message-Id: <9605202046.AA2891@VGI1MAIL.vanguard.com>
To: fastcgi-developers <fastcgi-developers@openmarket.com>
From: Patrick Walsh/VGI <Patrick_Walsh@vanguard.com>
Date: 20 May 96 13:42:14 EST
Subject: FCGI_PROCESS_ID variable

We don't seem to be seeing the environment variable FCGI_PROCESS_ID.  We are 
starting multiple instances of a server managed FCGI program.  We are using the 
AppClass "-affinity" option as well.  Any ideas?

To: Patrick_Walsh @ vanguard.com (Patrick Walsh/VGI) @ INET
cc: mbrown @ OpenMarket.com @ INET (bcc: Patrick Walsh/VGI)
From: mbrown @ OpenMarket.com (Mark Brown) @ INET
Date: 05/17/96 02:48:17 PM
Subject: Re: OpenMarket HTTP server


In the future please direct these questions to
fastcgi-developers@openmarket.com.  That way everyone gets
to see the question and answer.  You can add yourself
to the list; instructions at http://www.fastcgi.com/mail/.
(Alan and John are already on the list.)

    1) If a ticket expires and a new one is generated, will the
    session continue to be routed to the same FCGI process as the
    previous ticketed (expired) session?

I'm actually not sure.  If the ticket generator re-uses the
user ID when it re-issues the ticket, then the routing will
be preserved.  If not, then not.  With authenticated tickets
the routing won't change since the user ID doesn't change.

   2) Is there any way the FCGI process can know what number
   (instance) it is?  That is, if we start 10 processes, can
   each of them know if they are 1,2,3...10 etc?  Even if they
   terminate and are restarted?

Yes.  For server-managed FastCGI processes using session
affinity, the server supplies a variable called FCGI_PROCESS_ID
in the initial environment.  This variable ranges from 0 to N-1
where N is the number of processes in the AppClass directive.
When a process dies and is restarted, the server supplies the
same value of this variable so the process can locate and recover
its state.