Maximum number of rails processes

Discussion in 'Install/Configuration' started by pratiknaik, Sep 12, 2006.

  1. pratiknaik

    pratiknaik New Member

    Hi,

    On my ls server, I've set Max Connections to be 1. Even then, I see multiple rails process for the same vhost. Am I missing something ?

    Thank,
    Pratik
  2. mistwang

    mistwang LiteSpeed Staff

    Please upgrade to Ruby LSAPI 1.7 if you have not done so.
    What you observed is normal for current release because the way rails process being started. There is one ruby process which only fork/manage children ruby worker process to handle requests. The process manager in the parent process is allowed to start 2x processes configured under certain situation.
    So, when "Max connections" set to 1, you may see 2 ruby processes normally, and 3 in the worst case.

    We probably should skip the process manager in the parent process when "Max connections" has been set to 1, as it uses almost twice the resources.
  3. pratiknaik

    pratiknaik New Member

    Skipping process manager would be really nice thing to have for shared environment.

    I'll keep my eye on changelog for this :) Memory has always been the showstopper for hosts providing rails hosting!

    Thanks,
    Pratik
  4. mistwang

    mistwang LiteSpeed Staff

    Yes, proc manager should not be used when only 1 process is allowed per rails application.

    So, you think that only allow 1 ruby process is allowed for each application hosted in shared environment?
  5. pratiknaik

    pratiknaik New Member

    Ok..That was a bit selfish from my side ;)..I run freeonrails.com - a free rails hosting site. I'm taking a new server for the same. Initially, I was considering mongrel/apache 2.2.x. But after checking out litespeed, there's no looking back ! The box will have 4 GB of RAM. So I'm hoping to have around about 120-150 apps to be hosted there. And I'd be allowing just 1 rails process/host. And for sites receiving low traffic, and with litespeed serving static files - I don't think that should be an issue.

    But I'm sure that allowing 1 ruby process would be very useful for commericial hosting provider as well. Because with this kind of setup, it's likely that people will be selling hosting based on the number of rails processes allowed, rather than just space/bandwidth equation. Something like, Basic - 1 Rails, Intermediate - 3 Rails, Advanced - 5 Rails, etc. Because if they don't do that, one can run 100 rails apps with 1 GB of disk space, and that'd eat up all the memory.

    Thanks,
    Pratik

    P.S -> I'm seeing 4 ruby processes on a radiant cms I setup a while back - http://rbconf.rails.in But unable to reproduce after restarting the server. Will keep an eye on it.

  6. mistwang

    mistwang LiteSpeed Staff

  7. pratiknaik

    pratiknaik New Member

    Thanks a lot. Works like a charm !

    -Pratik

Share This Page