Skip to content

Commit

Permalink
Merge pull request #2259 from openstax/puma_worker_killer
Browse files Browse the repository at this point in the history
Restart puma workers when total memory usage is greater than 75%
  • Loading branch information
Dantemss authored Jan 20, 2021
2 parents aac4d17 + 8169925 commit d0f475c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
require 'puma_worker_killer'

PumaWorkerKiller.config do |config|
# Restart workers when they start consuming more than 1G each
# Restart workers when they start consuming too much of the RAM
config.ram = ENV.fetch('MAX_MEMORY') do
ENV.fetch('MAX_WORKER_MEMORY', 1024).to_i * NUM_WORKERS
end.to_i

config.frequency = 10

config.percent_usage = 1.0
config.percent_usage = 0.75

config.rolling_restart_frequency = false

Expand Down

0 comments on commit d0f475c

Please sign in to comment.