diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-14 06:06:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-14 06:06:25 +0300 |
commit | 29c01c6c91558358c37ba45b03f240632bfb918d (patch) | |
tree | c6475afaf98ce740e8ba5fe227e7bd4a95b692cd /lib/gitlab/cluster | |
parent | eed996ac33a60d5fd8315a62fec8beaa8e907e69 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/cluster')
-rw-r--r-- | lib/gitlab/cluster/puma_worker_killer_initializer.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/gitlab/cluster/puma_worker_killer_initializer.rb b/lib/gitlab/cluster/puma_worker_killer_initializer.rb index a8440b63baa..92c799875b5 100644 --- a/lib/gitlab/cluster/puma_worker_killer_initializer.rb +++ b/lib/gitlab/cluster/puma_worker_killer_initializer.rb @@ -3,7 +3,12 @@ module Gitlab module Cluster class PumaWorkerKillerInitializer - def self.start(puma_options, puma_per_worker_max_memory_mb: 850, puma_master_max_memory_mb: 550) + def self.start( + puma_options, + puma_per_worker_max_memory_mb: 850, + puma_master_max_memory_mb: 550, + additional_puma_dev_max_memory_mb: 200 + ) require 'puma_worker_killer' PumaWorkerKiller.config do |config| @@ -14,7 +19,11 @@ module Gitlab # The Puma Worker Killer checks the total RAM used by both the master # and worker processes. # https://github.com/schneems/puma_worker_killer/blob/v0.1.0/lib/puma_worker_killer/puma_memory.rb#L57 - config.ram = puma_master_max_memory_mb + (worker_count * puma_per_worker_max_memory_mb) + # + # Additional memory is added when running in `development` + config.ram = puma_master_max_memory_mb + + (worker_count * puma_per_worker_max_memory_mb) + + (Rails.env.development? ? (1 + worker_count) * additional_puma_dev_max_memory_mb : 0) config.frequency = 20 # seconds |