schneems / puma_auto_tune

Puma performance without all the (T)pain
227 stars 19 forks source link

Detect possible RAM by Ruby and just use `ulimit` command #15

Closed prathamesh-sonpatki closed 7 years ago

prathamesh-sonpatki commented 9 years ago
schneems commented 9 years ago

If you're going to inline the check, you can use this https://github.com/schneems/heroku_ulimit_to_ram/issues/1

Process.getrlimit
prathamesh-sonpatki commented 9 years ago

I get following values on heroku

irb(main):001:0>  Process.getrlimit(:CORE)
=> [0, 0]
irb(main):002:0>  Process.getrlimit(:CPU)
=> [18446744073709551615, 18446744073709551615]

Is it in bytes?

schneems commented 9 years ago

Bleh, i thought it was a drop in replacement. No worries. Thanks for the patch, though I wonder why bin/ isn't on the path. We set it in the Heroku buildpack.

prathamesh-sonpatki commented 9 years ago

@schneems May be we can disable it in test mode as this problem is happening while running tests?

schneems commented 9 years ago

I'm fine with skipping this feature in tests. If the command fails it should fallback to 512 regardless of why the command failed. Maybe we should capture the errors bin/heroku_ulimit_to_ram 2>/dev/null