6

I am running a Redmine instance with Passenger and Nginx. With only a handful of issues in the database, Redmine consumes over 80mb of RAM.

Can anyone share tips for reducing Redmine's memory usage. The Redmine instance is used by 3 people and I am willing to sacrifice on speed.

Natan Yellin
  • 6,063
  • 5
  • 38
  • 57
  • Not a solution , but , if you are not using REE (and using ruby 1.8.7) try it , for my apps it's 30% memory discount. – andrea Feb 11 '11 at 14:23

2 Answers2

3

There are not really and low hanging fruits. And if there were, we would've already included and activated them by default.

80 MB RSS (as opposed to virtual size which can be much more) is actually pretty good. In normal operation, it will use between 70 and 120 MB RSS per process (depending on the deployment model, rather few on passenger).

As andrea suggested, you can reduce your overall memory footprint by about one third when you use REE (Ruby Enterprise Edition, which is also free). But this saving can only achieved when you run more than one process (each requiring the above memory). REE achieves this saving by optimizing Ruby for a technique called Copy on Write, so that additional application processes take less memory.

So I'm sorry, your (hypothetical) 128 MB vServer will probably not suffice. For a small installation, you might be able to squeeze a minimal installation into 256MB, but it only starts to be anything but a complete pain in the ass at 512 MB (including database).

That's because of how Rails applications work in contrast to things like PHP. They require a running application server instance. That instance is typically able to answer one request at a time, using about the same amount of memory all the time. So your memory consumption is roughly equivalent to the number of application processes you run, independent of actual load. But if you tune your system properly, you can get quite a number of reqs/s out of one process.

Holger Just
  • 52,918
  • 14
  • 115
  • 123
  • Okay, I understand that. I am already using REE. So far, 160 MB (on a WebFaction plan) has been good enough for both Redmine and the small Django project that we are using Redmine for. That will probably change when the Django app goes live. – Natan Yellin Feb 13 '11 at 02:15
  • For Django apps, you can save some overhead by bypassing Django and serving static media files directly from Apache or Nginx. Do you have any tips like that for Ruby? – Natan Yellin Feb 13 '11 at 02:20
  • @aantn: As you are already using nginx+passenger, that's exactly what is happening. Static files are served directly by nginx and dynamic requests are forwarded to passenger to be answered by rails. – Holger Just Feb 13 '11 at 08:32
1

May be i am replying very late but i got stuck in the same issue and I found a link to optimize ruby/rails memory usage, which works for me

http://community.webfaction.com/questions/2476/how-can-i-reduce-my-rubyrails-memory-usage-when-running-redmine

It may be helpful for someone else.

linuxexplore
  • 409
  • 3
  • 7