summaryrefslogtreecommitdiff
path: root/config.ru
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-01-20 11:49:42 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2016-01-20 11:51:49 +0100
commit21fab4f41317fe3c7acc7f9395cb1222e4a41074 (patch)
tree4b27062a3f7a609e68755656fb4d29dff4b3fb19 /config.ru
parent481644ca7c9f763d4646ad557cc3bcf8f4f71816 (diff)
downloadgitlab-ce-21fab4f41317fe3c7acc7f9395cb1222e4a41074.tar.gz
Use env variables for Unicorn memory limits
This makes it easier for users to use their own limits based on their server configuration.
Diffstat (limited to 'config.ru')
-rw-r--r--config.ru5
1 files changed, 4 insertions, 1 deletions
diff --git a/config.ru b/config.ru
index a2525c81361..1b258e0bd5e 100644
--- a/config.ru
+++ b/config.ru
@@ -7,8 +7,11 @@ if defined?(Unicorn)
# Unicorn self-process killer
require 'unicorn/worker_killer'
+ min = (ENV['GITLAB_UNICORN_MEMORY_MIN'] || 200 * 1 << 20).to_i
+ max = (ENV['GITLAB_UNICORN_MEMORY_MAX'] || 250 * 1 << 20).to_i
+
# Max memory size (RSS) per worker
- use Unicorn::WorkerKiller::Oom, (200 * (1 << 20)), (250 * (1 << 20))
+ use Unicorn::WorkerKiller::Oom, min, max
end
end