1

I'm using rails 2.3.2 with ruby 1.8.7 and nginx passenger. This application is a RESTful API which serves around 700 requests per minute. Everything goes fine except the memory consumed is growing from 55 Mb to 120 Mb (1 day after).

Do I have to restart those instances every week? I wonder other people facing this problem as well? Or something wrong with this application?

Any suggestions?

Chamnap
  • 4,666
  • 2
  • 34
  • 46

1 Answers1

1

Try using REE (Ruby Enterprise Edition) instead of ruby 1.8.7.

It uses 33% less memory on average, and is 100% compatible with 1.8.7. Without looking at the code, it sounds like a garbage collection problem, which REE + passenger might be able to solve.

From what I've heard, ruby 1.9.2 has a lot of the same enhancements, but switching an app over to run on REE would probably be a lot easier than upgrading to 1.9.2.

ndbroadbent
  • 13,513
  • 3
  • 56
  • 85
  • Does most rails apps increase memory all the time like this? – Chamnap Jan 27 '11 at 10:32
  • I don't think so. But then again, you are using Rails 2.3.2, which is quite dated now. Its impossible to say what the problem is without looking at code, so theres only 2 suggestions I could give: Use REE, or upgrade to Rails 2.3.8 (which should be quite painless) – ndbroadbent Feb 01 '11 at 09:18