how do i spawn fcgi processes on the fly?

"Prometheus Prometheus" <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
hiho@ll

before i explain the problem:
Q1: is it correct that, the amount of spawned fcgi processes, which can 
handle fcgi requests, is defined at the start of the fcgi server? (cause 
that's how i understand, how a fcgi server works or to be more specific how 
the php fcgi server works, and i (the webserver) have no possibility to 
spawn new fcgi processes, to handle more requests)

i think my question needs some explanation, to know what exactly is the 
problem:
i have my own webserver (written in c++ on a linux box)
i'm using fcgi to handle requests

currently i'm talking about a php fcgi server
the requests are sent to the php fcgi server
i'm using lighttpd's spawn-php.sh script to start the fcgi server
as far as i understand the script, it creates a server socket on a specific 
port and then execv's php, which spawns child processes

the problem:
given is a php fcgi server which has only 1 child
this means the server can handle only 1 php request at one time
IF the php script which get's executed, calls another php script (e.g. via 
curl) using my webserver, the server tries to connect to the fcgi server
but since another script is executing it's a deadlock!
(i have such a similar problem with a few hundred requests concurrently and 
calling another php script)
Q2: anybody has an idea how to solve this?
      what i read on lighttpd website is that my (and lighttpd's) method is 
called "external spawning"
      i think i can solve this with internal spawning (if my webserver 
controls the fcgi processes)
but i don't understand how "internal spawning" works?
cause if i would try to create a second fcgi server i would get a "address 
already in use" error

to ask the question a little bit differnt:
Q3: php fcgi server uses an environment variable PHP_FCGI_CHILDREN which 
defines how many processes to spawn
      how can i (the webserver) make the PHP_FCGI_CHILDREN be variable, so i 
can spawn new childs on the fly?

thx@ll


___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.