[Resolved] Workergroup - Keeping parent processes alive

Status
Not open for further replies.
#1
I tried setting the max idle time configuration option to -1 to make sure at least one process for each user stays open at all times but shortly after the last child process disappears I get:
Code:
[INFO] [CLEANUP] Send signal: 10 to process: 870395 (the parent process)
My goal is to get it so all parent processes stay active (if not forever, for a long time) and child processes die off after 15-30 seconds idle to free up some ram.

Setting the MAX_IDLE_TIME environment variable seems to affect the time till the last child processes die but if there are a lot of processes idle all but 1 or 2 process die off, then MAX_IDLE_TIME seconds later the last 1-2 processes die followed a few seconds later by the parent process.
 
Last edited by a moderator:
#3
I added

Code:
<IfModule LiteSpeed>
LSPHP_ProcessGroup on
</IfModule>
to the include file for one virtual host to test. After restarting lsws that virtual host's processes spawn in their own parent process separate from all other virtual hosts. To me this indicates that it is enabled and functional.

The problem is stopping the parent process from getting killed off. I have the LSWS external app 'max idle time' set to -1 and the following in environment:

Code:
PHP_LSAPI_MAX_REQUESTS=10000
PHP_LSAPI_CHILDREN=50
LSAPI_MAX_PROCESS_TIME=600
LSAPI_SLOW_REQ_MSECS=5000
My understanding is since I haven't specified other environmental variables parent processes should idle forever and child processes should idle for 300 seconds. In reality parent processes idle for 15-30 seconds and child processes idle for less than that.

Non ProcessGroup children also seem to be dropping sooner than 300 sec when idle with Max Idle Time set to -1. If I set Max Idle Time to 300 child processes seem to time out normally but then the parent process still gets killed.

Setting Max Idle Time to 3600 and setting the environment variable LSAPI_MAX_IDLE=15 results in all processgroup child processes being held open and not closing after 15 seconds even though the suexec daemon php processes (every other vhost) exit after 15 seconds idle.

It appears the reason I was experiencing a lot of child processes dying off immediately with any configuration was due to the server ignoring the abort processing directive (I have it set to No Abort) when refresh is hit multiple times (even from trusted IP) so that seems to be unrelated.
 
#5
my test also show that
webadmin External App->lsphp5->Max Idle Time:-1
not work as expected but set to 3600 (for example) will work.
in this post http://www.litespeedtech.com/support/forum/showpost.php?p=76383&postcount=12

Sorry, I'm still not clear some points in your post. but will keep monitoring this thread.
Ok. My goal is:

1. PHP parent processes stay around for a very long time for opcode/var caching
2. PHP child process die off after a minute or two at most to free up RAM

Right now I am experiencing either one or the other. If I set max idle time to 3600 idle child processes stick around forever too, even if I set the environment variable LSAPI_MAX_IDLE=15 which with my understanding of the documentation should result in idle child processes going away after roughly 15 seconds. (Which is what starts happening for the sites still using suexec daemon, just not the one I set up to use processgroup)
 

NiteWave

Administrator
#6
now I think I'm clear about your issues.
trying to reproduce it....

I've set up a simplest test env -- only 1 apache vhost.
the test script is in this thread
http://www.litespeedtech.com/support/forum/showthread.php?t=7831

it meets the 2 goals you mentioned after I set "Max Idle Time" to 3600 instead of -1. and child lsphp5 process vanishes soon(or die off).

but once I set
Server->General->External Application Abort:No Abort
(initially it's default value: not set)
the child lsphp5 process always there with parent lsphp5 process.
(it has passed the default 5 minutes time long)
 

mistwang

LiteSpeed Staff
#7
Ok. My goal is:

1. PHP parent processes stay around for a very long time for opcode/var caching
2. PHP child process die off after a minute or two at most to free up RAM
The solution now is to uses the maxIdle to control #1, for #2, to use
http://www.litespeedtech.com/docs/webserver/config/extapps#pcKeepAliveTimeout

if a child loses its connection to web server, it will die.

Right now, LSWS override "LSAPI_MAX_IDLE" to the same value set by "Max Idle", we may change that in later release. however, above workaround should work now no matter what.
 

wanah

Well-Known Member
#8
I belive the problem has been solved.

Yesterday I updated phpselector alt-php'ss and still couldn't get past the 30 seconds.

After doing this I changed a setting in the litespeed interface and restarted litespeed, but it seems this was not enough.

I checked just now and managed to wait for 143 seconds so fait without loosing the cache.

I guess something was not taken into account, and only was when I added a new account to the server.

I'm now going to give xcache a try.
 
#9
Status
Not open for further replies.
Top