Skip to content

Commit

Permalink
nudging down workers and threads, caught another oomkill in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
pushcx committed Feb 28, 2024
1 parent bfaacba commit 2d2e04f
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 @@ -8,7 +8,7 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 4 }
threads threads_count, threads_count

# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
Expand All @@ -32,7 +32,7 @@
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
workers ENV.fetch("PUMA_WORKERS") { 4 }
workers ENV.fetch("PUMA_WORKERS") { 3 }

# In prod we run dozens of workers on a 4 core cpu. Puma starts all of them at
# the same time, pinning the CPU until the box is unresponsive. Where one
Expand Down

0 comments on commit 2d2e04f

Please sign in to comment.