Keep ruby RailsRunner.rb's running all the time?

inspirix

Active Member
#1
I understand that litespeed/lsapi manages the RailsRunner.rb running processes, shuts them down when they arent being used etc. But just for the sake of knowing, is it possible to make them all stay running until the webserver is shut down? Example: mysite.test, 5 max conn. in rails context. Im wondering if there are settings you could tweak so if you saw:

me 98214 0.0 6.3 36084 14972 ?? SNs 11:56AM 0:02.31 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
me 98215 0.0 6.3 36084 14972 ?? SNs 11:56AM 0:02.31 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
me 98216 0.0 7.0 35544 16592 ?? SNs 11:56AM 0:02.63 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
me 98217 0.0 4.4 23896 10328 ?? SNs 11:56AM 0:02.03 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb
me 98218 0.0 4.3 23896 10072 ?? SNs 11:56AM 0:02.04 ruby /usr/local/lsws/fcgi-bin/RailsRunner.rb

And then 5 hours later, even with Zero people accessing the webserver during that timeframe... you would see the same processes still running.

Ive played around with Keepalive and Max Idle, but cant tell which is the correct one, if either, for this usage.

Thanks!

Joe
 

mistwang

LiteSpeed Staff
#2
You can add a environment variable

LSAPI_MAX_IDLE=n

n is the maximum idle time in seconds that a child process will be waiting
for a new request. Once it is reached, the child process will quit.
Default value is 60. When n <= 0, the child process will wait indefinitely.
This option helps getting rid of idle children processes.
 
#3
I'm looking to do something similar, but changing the LSAPI_MAX_IDLE environment variable makes no difference. I've tried setting it to an hour and setting it to zero and either way it goes away after 60 seconds.
 

mistwang

LiteSpeed Staff
#4
LSAPI_MAX_IDLE is for children processes forked from the parent.

you also need to check "Max idle time" configuration under "server"->"ruby" tab.
 
Top