summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-11-01 21:45:40 +0000
committerRobert Speicher <robert@gitlab.com>2018-11-01 21:45:40 +0000
commit392e3bfad3c39dc4e4e8237b71e2ed9fd9bffcb0 (patch)
tree4e3303a166a95fc80d4324c0c00ba8ccfe45edbe
parenta80ee886e4b4a41ace5fb796bf920c4e395bf4dd (diff)
parentd19ba4439b4f0cda2aa5ab6e1fb7e4f4330738db (diff)
downloadgitlab-ce-392e3bfad3c39dc4e4e8237b71e2ed9fd9bffcb0.tar.gz
Merge branch 'sh-bump-puma-memory-limits' into 'master'
Reserve more RAM for master process in Puma See merge request gitlab-org/gitlab-ce!22741
-rw-r--r--lib/gitlab/cluster/puma_worker_killer_initializer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/cluster/puma_worker_killer_initializer.rb b/lib/gitlab/cluster/puma_worker_killer_initializer.rb
index 331c39f7d6b..4ed9a9a02ab 100644
--- a/lib/gitlab/cluster/puma_worker_killer_initializer.rb
+++ b/lib/gitlab/cluster/puma_worker_killer_initializer.rb
@@ -11,7 +11,11 @@ module Gitlab
# Importantly RAM is for _all_workers (ie, the cluster),
# not each worker as is the case with GITLAB_UNICORN_MEMORY_MAX
worker_count = puma_options[:workers] || 1
- config.ram = worker_count * puma_per_worker_max_memory_mb
+ # The Puma Worker Killer checks the total RAM used by both the master
+ # and worker processes. Bump the limits to N+1 instead of N workers
+ # to account for this:
+ # https://github.com/schneems/puma_worker_killer/blob/v0.1.0/lib/puma_worker_killer/puma_memory.rb#L57
+ config.ram = (worker_count + 1) * puma_per_worker_max_memory_mb
config.frequency = 20 # seconds