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

Discussion in 'Install/Configuration' started by inspirix, Oct 24, 2006.

  1. inspirix

    inspirix New Member

    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
  2. mistwang

    mistwang LiteSpeed Staff

    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. sfreiberg

    sfreiberg New Member

    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.
  4. mistwang

    mistwang LiteSpeed Staff

    LSAPI_MAX_IDLE is for children processes forked from the parent.

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

Share This Page