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 go开发者_运维百科es 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?
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.
精彩评论