OpenNebula / addon-appmarket

AppMarket builds a centralized catalog of cloud applications
http://opennebula.org/addons:addons
Apache License 2.0
10 stars 13 forks source link

Memory leak in appmarket daemon #51

Open tunaman opened 9 years ago

tunaman commented 9 years ago

Hi,

We have been using the appmarket for a while now in our production environment, however we noticed that the appmarket daemon tends to grow with ~ 400MB of memory per day which eventually leads to the OOM killer to kick in.

If there is any interest from the developers i can provide atop logs.

dmamolina commented 8 years ago

Hi,

What ruby and gem version are you using? Could you check if upgrading to the latest gem versions fix the issue? (Note that mongo gem >= 2 is not supported)

tunaman commented 8 years ago

Hi,

sorry for the late response. If I upgrade the gems everything will be updated to 4.14 I guess and I can no longer use the required mongodb gem right? Or are you suggesting that we only update specific gems? Ruby version and installed gems below.

[root@appmarket4 ~]# ruby -v
ruby 2.0.0p353 (2013-11-22) [x86_64-linux]
[root@appmarket4 ~]# gem list

*** LOCAL GEMS ***

bcrypt (3.1.10)
bcrypt-ruby (3.1.5)
bigdecimal (1.2.0)
bson (1.12.3)
bson_ext (1.12.3)
builder (3.2.2)
bundle (0.0.1)
bundler (1.10.5)
haml (4.0.6)
io-console (0.4.2)
json (1.8.3, 1.7.7)
mail (2.6.3)
mime-types (2.6.1)
mini_portile (0.6.2)
mongo (1.12.3)
nokogiri (1.6.6.2)
open4 (1.3.4)
opennebula (4.12.1)
opennebula-cli (4.12.1)
psych (2.0.0)
rack (1.6.4)
rack-protection (1.5.3)
rbvmomi (1.8.2)
rdoc (4.0.0)
redcarpet (2.3.0)
sinatra (1.4.6)
tilt (2.0.1)
trollop (2.1.2)
uuidtools (2.1.5)
dmamolina commented 8 years ago

Upgrading gems will not upgrade AppMarket, but as you mention mongo >= 2 is not supported, you can pass an option to the upgrade command for this.

After checking your gem list, I recommend you to install thin server (gem install thin), since you are currently running AppMarket on top of webrick.

And for production environments using Apache/Passenger is recommended. You can use Sunstone configuration guide to get an idea on how to do this for AppMarket: http://docs.opennebula.org/4.14/advanced_administration/scalability/suns_advance.html#running-sunstone-with-passenger-in-apache

tunaman commented 8 years ago

Thank you for your elaborate answer, so if I'm correct upgrading the gems, installing thin thin and switching to a apache/nginx passenger configuration should get rid of the memory leak? Or just one of these options?