Too many ruby procs (RoR)


#1

Hi all

I have set up my RoR application as it is suggested in the Dreamhost Wiki. Now I got many “Application failed to start properly” errors from time to time, and the support told me, that I have too many Ruby processes!
What can I do against that? I have no knowledge about such stuff at all…

Quote from support:
You may want to make some tweaks to make sure that you aren’t spawning more ruby procs then what you can keep under that memory limit.

Thanks a lot for informations


#2

“You may want to make some tweaks to make sure that you aren’t spawning more ruby procs then what you can keep under that memory limit.”

I’m also curious what that means… The spawning of processes is under their control (FastCGI options?) so that should be their job… Am I being wrong?


#3

They definitely did something recently (to my server ‘temple’ - what server are you on?): my rails apps show intermittent error screens, fastcgi processes behave erratically - they start and die even though no one accesses the app etc.

I can trace these problems back to the time when they put the server ‘temple’ under observation and tweaked ‘procwatch’ and other settings to improve performance…


#4

I’m seeing the same sort of problems, and have no idea how to control the number of processes. Also, from the logs it looks like my RAM limit used to be 200 MB for a little while after I signed up a week or so ago, but now it’s 100 MB. I’ve never seen any actual policy statement on RAM limits, but messing around with the limit without warning is a HUGE no-no…

Has anyone resolved how to either crank down the number of FCGI processes spawned or increase the RAM limit?


#5

Or at least they should have limited the number of processes when they limited the RAM usage (or give us the possibility to do it, per user). Moreover, it seems that threads (which some linux utils present as procs using the same amount of RAM as the owning process) also count towards the total RAM usage.


#6

From what I’ve been able to gather from the internet, those settings are placed in apache.conf, to which only DH has access.


#7

I’m glad others are seeing this problem. I’ve been seeing it for a couple of weeks now and haven’t had a chance to debug it. I see it most often with an image upload page. Has anyone gotten any word on a solution? Should I submit it as a support issue?


#8

Do it and if appropriate, share the findings.

Wholly


#9

So I send a note to support and got a fairly useful reply back. There’s a pointer to an article that seems related. The note also included some interesting info on how monitoring works. However, looking at my current processes they appear to be far below the numbers given in the article, so I’ve asked for some more details on the settings that DreamHost is using. I also suspect that the reply is using the term ‘zombie’ not in the technical sense, since I’ve never seen a true zombie ruby process and the article doesn’t mention that as an issue.

-Nathan


Our logs show that your processes are triggering ProcWatch. Im certain
that you have zombie ruby processes guzzling memory, which is causing
your processes to get killed. I can suggest that you setup a cronjob to
periodically kill these zombie processes. Here’s an article that I found
regarding this topic
http://www.rubyonrailscamp.com/MaxWiki+Trials+and+Tribulations. If you
have any additional questions, please let us know.

2006-12-18 15:33:40 kill 17072 velosa ruby "Ruby
process puts user over the ruby memory limit (21.5703125 / 200)"
2006-12-18 15:43:23 kill 12731 velosa ruby "Ruby
process puts user over the ruby memory limit (21.89453125 / 200)"
2006-12-18 15:45:57 kill 6020 velosa ruby "Ruby
process puts user over the ruby memory limit (21.6015625 / 200)"
2006-12-18 15:53:38 kill 8759 velosa ruby "Ruby
process puts user over the ruby memory limit (21.8984375 / 200)"
2006-12-18 15:53:38 kill 12396 velosa ruby "Ruby
process puts user over the ruby memory limit (21.56640625 / 200)"
2006-12-18 16:03:52 kill 4832 velosa ruby "Ruby
process puts user over the ruby memory limit (21.90234375 / 200)"
2006-12-18 16:03:52 kill 22182 velosa ruby “Ruby
process puts user over the ruby memory limit (21.5703125 / 200)”


#10

Hmmmm…

memory limit (21.5703125 / 200)

That doesn’t LOOK like it’s over limit.

Wholly