Rails taking too much RAM

351 views
Skip to first unread message

np

unread,
Aug 28, 2010, 1:24:36 PM8/28/10
to Ruby on Rails: Core
Hi,

I am trying to deploy my application that requires rails-2.3.8,
ferret_server running in background(DRB) and workling_client+sterling.

Above configuration is running on a VPS with 512MB, latest Ruby
Enterpise Edition+
passenger+nginx+mysql. But I continue to see out of memory issues.
What I notice that every ruby thread is consuming 15%of 512MB(from
top) including workling and ferret_server.

Are there some ways to fine tune ruby, passenger or others to make
sure that I do not run out of memory ? From REE documentation, it
seems that ruby thread spawned by passenger can share rails
environment
and application code. Is it possible to do similar kind of sharing
with passenger+ferret_server+workling, because it seems that each one
of these is loading same code separately.

What are the the other ways to reduce RAM requirement ?

Any help will be appreciated.

Thanks,
np

rogerdpack

unread,
Aug 31, 2010, 1:39:32 PM8/31/10
to Ruby on Rails: Core

> What are the the other ways to reduce RAM requirement ?

You probably need to figure out what is eating all that RAM.
memprof might help.
-r

gautam chekuri

unread,
Sep 1, 2010, 10:52:23 AM9/1/10
to Ruby on Rails: Core
Hi,

Time and again i've realized that the if my ruby processes running
rails code were eating up memory and increasing consistently in mem-
size after every incoming http request, then it was post probably
because of the way it was coded. The post has some info on these
aspects: http://www.engineyard.com/blog/2009/thats-not-a-memory-leak-its-bloat/
. http://github.com/noahd1/oink was helpful when it came to checking
which actions result in what kind of increase in the memory usage.

It also seemed to be that the more routes my rails app had (typically
due to different kinds of nesting of resources) the bigger was the
size of the ruby processes.

If the code of your app seemed pretty much in control, then it might
be case that you are running it in development mode. I've seen that
switching the app to production mode can stabilizes the process size.
Reply all
Reply to author
Forward
0 new messages