summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-01-20 18:44:51 +0000
committerRobert Speicher <robert@gitlab.com>2016-01-20 18:44:51 +0000
commit67bd2ed3a2d1d58cc54dc2def1409f185fa01529 (patch)
tree9d5f66dd558a4831eef57498984f08417a620ed7
parent2d8b6901baf425e59b47919283c4805fde3c9e1b (diff)
parent89c65a3789ab51d58633841120c33f570064f242 (diff)
downloadgitlab-ce-67bd2ed3a2d1d58cc54dc2def1409f185fa01529.tar.gz
Merge branch 'adjust-unicorn-memory-limits' into 'master'
Use ENV variables for Unicorn worker killer & increase default limits Merge request that lead to this particular merge request: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2421 [ci skip] See merge request !2513
-rw-r--r--config.ru5
-rw-r--r--doc/administration/environment_variables.md2
2 files changed, 6 insertions, 1 deletions
diff --git a/config.ru b/config.ru
index a2525c81361..065ce59932f 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'] || 300 * 1 << 20).to_i
+ max = (ENV['GITLAB_UNICORN_MEMORY_MAX'] || 350 * 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
diff --git a/doc/administration/environment_variables.md b/doc/administration/environment_variables.md
index 1eb3a74d304..42a27dcf6d6 100644
--- a/doc/administration/environment_variables.md
+++ b/doc/administration/environment_variables.md
@@ -17,6 +17,8 @@ DATABASE_URL | url | For example: postgresql://localhost/blog_development?pool=5
GITLAB_EMAIL_FROM | email | Email address used in the "From" field in mails sent by GitLab
GITLAB_EMAIL_DISPLAY_NAME | string | Name used in the "From" field in mails sent by GitLab
GITLAB_EMAIL_REPLY_TO | email | Email address used in the "Reply-To" field in mails sent by GitLab
+GITLAB_UNICORN_MEMORY_MIN | integer | The minimum memory threshold (in bytes) for the Unicorn worker killer
+GITLAB_UNICORN_MEMORY_MAX | integer | The maximum memory threshold (in bytes) for the Unicorn worker killer
## Complete database variables