zombocom / puma_worker_killer

Automatically restart Puma cluster workers based on max RAM available
748 stars 77 forks source link

worker.inspect generates extremely verbose logs #32

Closed swrobel closed 8 years ago

swrobel commented 8 years ago

Logs are generated in spots such as this. Example log:

PumaWorkerKiller: Rolling Restart. 2 workers consuming total: 193.29296875 mb out of max: mb. Sending TERM to #<Puma::Cluster::Worker:0x007f9af3016ab8 @index=0, @pid=43203, @phase=0, @stage=:booted, @signal="TERM", @options=#<Puma::LeveledOptions:0x007f9afd54ea08 @cur={}, @set=[{}, {:log_requests=>false, :environment=>"development", :binds=>["tcp://localhost:3000"], :app=>#<Rack::ContentLength:0x007f9afd54f408 @app=#<NewRelic::Agent::Instrumentation::MiddlewareProxy:0x007f9afd52cf20 @target=#<Surkus::Application:0x007f9af3f417e0 @_all_autoload_paths=

It goes on from there for hundreds of lines from there

schneems commented 8 years ago

Maybe we use the pid instead?

swrobel commented 8 years ago

Works for me. I would've submitted a PR, but I wasn't sure if there was some specific attribute you were originally intending to show when you chose inspect, or whether Puma changed the behavior of inspect in a recent version.

schneems commented 8 years ago

Previously it was smaller. I used inspect because I didn't know what to put in there. We could maybe make it overwriteable but i think i'm fine with using PID for now as it's a unique identifier. Would you have time to send me a PR with that change?