diff --git a/config.ru b/config.ru index c4c4031568..e2d03deb47 100644 --- a/config.ru +++ b/config.ru @@ -5,8 +5,12 @@ if ENV.fetch('KILL_UNICORNS', false) && ['production', 'staging'].include?(ENV[' # - performed between 25000 and 30000 requests # - grown in memory usage to between 700 and 850 MB require 'unicorn/worker_killer' - use Unicorn::WorkerKiller::MaxRequests, 25_000, 30_000 - use Unicorn::WorkerKiller::Oom, (700 * (1024**2)), (850 * (1024**2)) + use Unicorn::WorkerKiller::MaxRequests, + ENV.fetch('UWK_REQS_MIN', 25_000).to_i, + ENV.fetch('UWK_REQS_MAX', 30_000).to_i + use Unicorn::WorkerKiller::Oom, + ( ENV.fetch('UWK_MEM_MIN', 700).to_i * (1024**2) ), + ( ENV.fetch('UWK_MEM_MAX', 850).to_i * (1024**2) ) end require ::File.expand_path('../config/environment', __FILE__)