Running lsphp standalone

#1
Hello, I set up Litespeed to handle php through the load balancer which talks to a standalone lsphp process listening in the background on the same machine.
I would like to ask a few things.

1) If I want, for example, 4 lsphp processes listening for connections from Litespeed should I start each one of them on a different port in this way?

/pathtoexecutable/lsphp -b 127.0.0.1:1234 &
/pathtoexecutable/lsphp -b 127.0.0.1:1235 &
....

Is this correct?

2) The environment variables like LSAPI_CHILDREN or PHP_LSAPI_CHILDREN are only useful if lsphp process are spawned by the server and not when running in standalone mode.
Am I right?

3) While testing with lsphp in standalone mode I noticed that an idle process just dies after at most ten minutes. Is this to be expected?

4) When doing tests (with siege) with only one external lsphp process, if I use a concurrency above 1, in a few minutes I start getting many errors like these:

Code:
No request delivery notification has been received from LSAPI process:-2, possible run away process.
INFO	[127.0.0.1:59111-0#vhost] connection to [127.0.0.1:1234] on request #0, error: Connection timed out!
or these:

Code:
[127.0.0.1:53411-0#vhost] connection to [127.0.0.1:1234] on request #0, error: Connection refused!
INFO	[127.0.0.1:7777] Connection refused, restart!
NOTICE	[127.0.0.1:53411-0#vhost] oops! 503 Service Unavailable
NOTICE	[127.0.0.1:53411-0#vhost] Content len: 0, Request line:
GET /phpinfo.php HTTP/1.1
Is this normal with concurrency > 1 and only one lsphp process?
Please note that this can't be related to CPU stress since I get these errors even with a concurrency of 6 which leaves the CPU in 98% idle.

I have the impression that there is nothing wrong with Litespeed handling external lsphp processes through the load balancer module, but the problems in points 3 and 4 are intrinsic into php when it runs as a standalone process.
Meaning that it just dies after being idle for some time and that cannot handle even a modest concurrency on a single process without spitting out errors.

If I'm overlooking something important please let me know.

I was looking forward to spawn standalone lsphp processes under a different user than the one related to the webserver. But I think the only way to do this is using the method described above, which unfortunately seems to be broken. Although not for an issue with Litespeed.
Isn't there any way to have Litespeed start and manage the lsphp processes with a different user than the one which is bound to the webserver?

I'm looking forward to your replies, thanks.
 

mistwang

LiteSpeed Staff
#2
1) No, just set LSAPI_CHIDLREN when you start PHP from command line
2) LSAPI_CHIDLREN works when started from command line as well.

3) Yes, you can tune this through environment variables.
http://www.litespeedtech.com/php-litespeed-sapi.html

4)
Is this normal with concurrency > 1 and only one lsphp process?
Yes, that's normal, number of lsphp processes and concurrency must match, or number of lsphp processes are higher.
 
#3
Thanks for the clarifications.
I just wanted to confirm that after setting the proper environment variables Litespeed provides excellent performance and stability even with manually spawned lsphp processes.
 
Top