Commit d3140f44 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'gdk-672-bump-puma-killer-limits-for-dev' into 'master'

Increase PumaWorkerKiller memory limit for dev

Closes gitlab-development-kit#672

See merge request gitlab-org/gitlab!20039
parents 057a7462 fcea6c49
---
title: Increase PumaWorkerKiller memory limit in development environment
merge_request: 20039
author:
type: performance
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
module Gitlab module Gitlab
module Cluster module Cluster
class PumaWorkerKillerInitializer 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' require 'puma_worker_killer'
PumaWorkerKiller.config do |config| PumaWorkerKiller.config do |config|
...@@ -14,7 +19,11 @@ module Gitlab ...@@ -14,7 +19,11 @@ module Gitlab
# The Puma Worker Killer checks the total RAM used by both the master # The Puma Worker Killer checks the total RAM used by both the master
# and worker processes. # and worker processes.
# https://github.com/schneems/puma_worker_killer/blob/v0.1.0/lib/puma_worker_killer/puma_memory.rb#L57 # 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 config.frequency = 20 # seconds
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment