spawning multiple php-instances listening on tcp/ip ?

ts77

Well-Known Member
#1
Hi there,

are there some nice and simple command-line options to let litespeed start multiple php-fcgi instances (those are different versions) listening on different ports (needed for multi-server usage) instead of using a socket?

I'm currently using spawn-fcgi but that install takes only one php instance either. I might try to experiment with it further if there's no option in lsws to do this ... just wanted to try this route first :).


thanks,

thomas
 

mistwang

LiteSpeed Staff
#2
You can let fcgi application started by LSWS using tcp instead of unix socket. but LSWS only start them on demand, so it may not be a good choice for pure fcgi spawner. :)

Actually, php-fcgi itself has an option "-b" to bind to an address. It hasnot be implemented in earlier release, but seems now it is.
 

ts77

Well-Known Member
#3
hmm, good point mistwang.
any good pointers for some standalone fcgi-spawner?
I want the two servers being able to use each others php-processes as they will work in a failover environment.
 

mistwang

LiteSpeed Staff
#4
Only other standalone fcgi-spawner I know of is the "cgi-fcgi" from FCGI SDK. ;-) May not be anything better than fcgi-spawner.

Maybe I can add an option to let LSWS start FCGI at server startup. :)
 

ts77

Well-Known Member
#5
> Maybe I can add an option to let LSWS start FCGI at server startup.

yeah, that would be very cool :D no need for external spawners anymore.
 

xing

LiteSpeed Staff
#6
Release 2.1.15 now has this feature. You can now optionally set configured external applications to start on server start-up versus on-demand. Enjoy.
 

ts77

Well-Known Member
#7
thanks, I'll try it out ASAP.

just another question:
with spawn-fcgi I have that option in the config:
Code:
## IP adresses where PHP should access server connections
## from
FCGI_WEB_SERVER_ADDRS="127.0.0.1,192.168.0.1"
Is that a simple ENV-variable which is used from php if given or is that something unique to spawn-fcgi?

I think the web is really lacking some description of the php fastcgi setup without using some predefined stuff :(.
 

mistwang

LiteSpeed Staff
#9
Thanks for the information. It may not work well when you need to start multiple instances binding to the same address, may got address is already in use error. :)
 

mistwang

LiteSpeed Staff
#11
Yeah, it depends on how it was used. Pretty handy for FastCGI that can spawn children process, but is not good for on demand dynamic spawning that LSWS is capable of .
 
Top