arches / whacamole

restart heroku dynos that run out of RAM instead of swapping to disk
115 stars 12 forks source link

Restart threshold should be a config option #7

Closed jeffblake closed 10 years ago

jeffblake commented 10 years ago

Looking through the source, it appears that RESTART_THRESHOLD is hard coded at 1000 (MB). This is great for people running 2x dynos, but not so much for the 1x'ers.

jeffblake commented 10 years ago

It actually looks like @homanchou implemented this in https://github.com/homanchou/whacamole/commit/af04720edc7a2b64a3f04988954d2d80dd0f32fe

homanchou commented 10 years ago

yeah, you just do something like:

 Whacamole.configure('app-name') do |config|
   config.restart_threshold = 500 #restarts when memory usage exceeds 500MB
   ...
arches commented 10 years ago

oh nice! @homanchou could you PR that commit? thanks :)

homanchou commented 10 years ago

Created PR https://github.com/arches/whacamole/pull/8, though the branches have diverged a bit since I did this a while ago.

arches commented 10 years ago

thanks @homanchou! this issue is resolved in v1.1