zombocom / puma_worker_killer

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

Web worker not getting killed on Heroku #88

Closed kapso closed 4 years ago

kapso commented 4 years ago

Following is my configuration for the puma.rb file. I am using a 1GB web dyno on Heroku.

# puma.rb
before_fork do
  require 'puma_worker_killer'

  PumaWorkerKiller.config do |config|
    config.ram = 1024 # mb
    config.frequency = 1.minute.to_i
    config.percent_usage = 0.97
    config.reaper_status_logs = true
  end

  PumaWorkerKiller.start if Rails.env.production?
end

Heroku Logs -

Jul 07 01:46:27.977pm info heroku web.1 Process running mem=1310M(127.9%)
Jul 07 01:46:27.982pm info heroku web.1 Error R14 (Memory quota exceeded)
schneems commented 4 years ago

https://github.com/schneems/puma_worker_killer#turn-on-rolling-restarts---heroku-mode

kapso commented 4 years ago

@schneems Thanks, I am now using the following, but I don't see any PumaWorkerKiller in the Heroku logs, is that normal?

before_fork do
  require 'puma_worker_killer'

  PumaWorkerKiller.enable_rolling_restart(4.hours.to_i) if Rails.env.production?
end
schneems commented 4 years ago

Do you see the logs when you run locally?

I’m not really set up to give app support here I recommend posting the problem on stack overflow. If you have a bug you can provide a reproduction for them open an issue.

On Thu, Jul 9, 2020 at 3:47 PM Kapil notifications@github.com wrote:

@schneems https://github.com/schneems Thanks, I am now using the following, but I don't see any PumaWorkerKiller in the Heroku logs, is that normal?

before_fork do require 'puma_worker_killer'

PumaWorkerKiller.enable_rolling_restart(4.hours.to_i) if Rails.env.production?end

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/schneems/puma_worker_killer/issues/88#issuecomment-656343250, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOSYFIH7NH4IULJUVJ463R2YUF7ANCNFSM4OTTL2XA .

-- Richard Schneeman https://www.schneems.com he/him