My rails sites run Mongrel, I am having a problem with the amount of memory being used. My ruby-bin processes are using up about 66 MB of resident memory. How can I reduce the amount of memory used by rails?
It is not very economical to have many rails servers running on a single machine if they are eating memory at this rate. My php5 fcgi processes sit at between 15-25 MB.
I'm fairly unfamiliar with RoR, would using JRuby help? Any comments helpful in reducing memory footprint and increasing performance are more than welcome.
You might look at Phusion Passenger and Ruby Enterprise Edition, which is the de facto standard setup for Rails apps these days. One of its aims is cutting memory use. It's also simpler than having a bunch of Mongrels.
If you are not tied to apache for something else, i would also try nginx with Phusion Passenger. If you're concerned about memory usage, you should see a smaller footprint from nginx than apache, and the lastest version of Passenger will download, compile and install nginx for you with minimal headaches.
You can also replace your mongrel process with Thin which is more efficient and has recently been patched in its Garbage Collection (thru eventmachine), to make it even better.
We use thin cluster behind nginx frontends with fine results.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With