Maximum number of rails processes

#1
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 ?

11680 chetan 18 3 14752 12m 1460 S 0.0 6.6 0:01.00 ruby
13434 chetan 18 3 14756 12m 1460 S 0.0 6.6 0:01.02 ruby
13791 chetan 18 3 14748 12m 1460 S 0.0 6.6 0:00.97 ruby
Thank,
Pratik
 

mistwang

LiteSpeed Staff
#2
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
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
 

mistwang

LiteSpeed Staff
#4
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
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.

20991 rbconf 18 3 14756 12m 1460 R 0.0 6.6 0:01.08 ruby
22246 rbconf 18 3 14756 12m 1460 R 0.0 6.6 0:01.08 ruby
23217 rbconf 18 3 14748 12m 1460 R 0.0 6.6 0:01.03 ruby
21651 rbconf 18 3 14748 12m 1460 R 0.0 6.6 0:01.22 ruby
 
Top