Re: multi-processes

Bill Snapper (
Wed, 11 Sep 1996 21:14:24 -0300

Message-Id: <>
Date: Wed, 11 Sep 1996 21:14:24 -0300
From: Bill Snapper <>
To: Roger Day <>
Subject: Re: multi-processes

Roger Day wrote:
> Hi,
> having compiling and run works just fine and handsome.
> There is one question: each registered app can have as many pre-forked processes
> as you wish.
> My question is...why? I can understand one, but if you try the tiny-perl-fcgi
> with two processes you get this on subsequent calls to the same script
> 1 1
> 2 2
> 3 3
> 4 4
> 	Roger, the reason you're seeing this is that while there are
two processes running, they're both doing the same thing.  There's
no state shared between the processes.  Each process is blocking on
a FCGI_Accept call and when you hit the URL that defines it, you get one
of the processes.  A subsequent hit will cause the other process to 
accept the next connection and therefore process the request, and so on.

	The reason you would want multiple processes running and 
listening on the same port is load driven.  If you have a FastCGI 
application which needs to support lots of requests and you don't want
requests blocking, you can add more processes so that multiple requests
can run concurrently.  If you onle define a single FastCGI process
with the example you've described, you can only run one request at a
time regardless of the number of httpd listener processes you have 

	Hope this helps,

	   - Bill -

Bill Snapper           | Open Market, Inc.   | My opinions are my own,
Software Engineer      | 245 First St.       | and not necessarily | Cambridge, MA 02142 | those of my employer, 
1-617-374-6501         |                     | Open Market Inc.