|
|

09-11-2006, 02:54 PM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
Getting Lots of Ruby Processes
I am testing LS on a VPS running RH9. It is not beng accessed by more than 3 people. Probably none of them concurrently.
When I restart the server I have 2 ruby instances. In the 6 or so hours since I restarted this morning, I now have 16 ruby instances. Eventually I end up with about 25 - 30 of them and the Rails application stops responding.
UPDATE:
2 hours later - Now up to 22 ruby instances.
Any idea what might be going on here?
Last edited by jp_n9; 09-11-2006 at 04:45 PM..
Reason: Typo
|

09-11-2006, 05:36 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,583
|
|
|
What is your "max connection" setting? which version of LSAPI has been installed?
Is that possible for me to login and take a look at the server?
|

09-11-2006, 07:00 PM
|
|
Member
|
|
Join Date: Aug 2006
Posts: 18
|
|
|
This is funny, I am getting the same kind of issue, I have set the max connections for each of my VHosts to 3, but if this morning I noticed I had 16 processes.. at 20mb each, it eats up my half gig pretty easily..
I also wonder why LS starts a new RailsRunner when I click on a link in my RoR generated page, even though it already has 6 processes started (this is after I did a graceful restart)
I have NO users. None. Nada. Just me. and I don't have aborted connections or anything like that at all.
I'm using LSWS 2.2 and the latest version of the ruby-lsapi 1.6 gem. The backend database is postgres.
|

09-11-2006, 07:35 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,583
|
|
|
When LSWS being started gracefully, all associated ruby processes should be killed after all pending requests has been served. The new LSWS instance will start it own group of ruby processes.
The problem is that ruby processes won't die after being killed by LSWS. We spent some time on work around on this issue.
Please upgrade to ruby-lsapi 1.7, if the problem persist, I need to take a look.
|

09-11-2006, 08:29 PM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
Quote:
Originally Posted by mistwang
What is your "max connection" setting? which version of LSAPI has been installed?
Is that possible for me to login and take a look at the server?
|
Max connection is set to 300. I believe it is LSAPI version 1.6.
I'll send you the login in a private message.
There are now 36 ruby processes that have been started.
Last edited by jp_n9; 09-11-2006 at 08:30 PM..
Reason: Update
|

09-12-2006, 03:35 AM
|
|
Member
|
|
Join Date: Aug 2006
Posts: 18
|
|
Quote:
Originally Posted by mistwang
When LSWS being started gracefully, all associated ruby processes should be killed after all pending requests has been served. The new LSWS instance will start it own group of ruby processes.
The problem is that ruby processes won't die after being killed by LSWS. We spent some time on work around on this issue.
Please upgrade to ruby-lsapi 1.7, if the problem persist, I need to take a look.
|
I updated to 1.7 and it seems to be holding much better when I use "ab". The process count doesn't increase.
lsapi 1.7 seems about 3-5% slower (vs 1.6) on the same machine though, but that's just a rough calc. database intensive pages seem to be around 10-15% slower, but that is just off of one reading so it may be way off.
btw, I didn't have any problem with the ruby processes not dying when I stopped LSWS, it is just that even though I had 6 already up and running with 0 requests, if I clicked on a link, it would fire up a new one, which doesn't really make sense to me..
Is there some tech spec as to how many HTTP connections are pooled per RailsRunner (ruby-lsapi) process?
thx,
-Amr
|

09-12-2006, 04:47 AM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 20
|
|
|
I've had the same issues, it sometimes builds up a huge number of processes and eats up all the available memory.
I did notice another thing, I'm running a few Rails 1.0 apps and they broke down with the new 2.2.1 release.
/home/***/app/current/../vendor/rails/activerecord/lib/active_record/base.rb:991:`method_missing': undefined method `clear_active_connections!' for ActiveRecord::Base:Class (NoMethodError)
from /usr/local/lsws/fcgi-bin/RailsRunner.rb:9
The 1.1 apps work great. I haven't seen the processes get out of hand since I moved the 1.0 apps back to Mongrel. Maybe this has something to do with it?
|

09-12-2006, 05:31 AM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
|
Overnight it grew to 50 processes, causing the app to stop responding. Now I just get the 503 Service Unavailable error.
Did the "Graceful Restart", and that killed all the processes and restarted 2. Here we go again...
|

09-12-2006, 07:50 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,583
|
|
|
jp_n9:
Please upgrade ruby LSAPI to 1.7. Your 'Max connection' is way too high, your VPS does not have enough memory to start 300 ruby processes. your server could be DoS attacked by a simple request flood. please try '10' first. I I will take a look at your server if the problem persist with 1.7 release.
Amr,
LSWS 2.2.1 + LSAPI 1.7 will close the DB connection established during initialization, so the first request will be slow down a little, but the subsequent requests should be processed as fast as before.
Thijs,
Looks like 'clear_active_connections!' is a new function for rails 1.1, we need to implement something similar for 1.0 to deal with the DB connections.
|

09-12-2006, 08:04 AM
|
|
Member
|
|
Join Date: Sep 2006
Posts: 38
|
|
Quote:
Originally Posted by mistwang
jp_n9:
Please upgrade ruby LSAPI to 1.7. Your 'Max connection' is way too high, your VPS does not have enough memory to start 300 ruby processes.
|
I didn't understand that "Max connection" == "Max Ruby Processes", otherwise I would have set it much lower.
Even still, it would seem that something was wrong if it keeps spawning new processes when at most two users are ever accessing it at once (most likely only one at a time).
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:30 AM.
|
|