From 88195836b7d5372288a96ef023bb1d0ee2c0eb9e Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sat, 13 Feb 2021 16:47:30 +0100 Subject: [PATCH] gitlab: Make memory limits configurable This patch adds two new variables to the gitlab playbook, making the memory limits of the container configurable and this way easier to adjust to one's needs. --- roles/gitlab/defaults/main.yml | 7 +++++++ roles/gitlab/templates/docker-compose.yml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/roles/gitlab/defaults/main.yml b/roles/gitlab/defaults/main.yml index 68f022f..87e5838 100644 --- a/roles/gitlab/defaults/main.yml +++ b/roles/gitlab/defaults/main.yml @@ -42,6 +42,13 @@ gitlab_version: 13.8.4-ce.0 # The port you want Gitlab to listen on for SSH connections gitlab_ssh_port: 22 +# The memory limits for the GitLab container +# +# Notice the gitlab_memoryswap_limit must be equal +# or higher than the gitlab_memory_limit +gitlab_memory_limit: "4096mb" +gitlab_memoryswap_limit: "4352mb" + # Email/SMTP settings gitlab_smtp_address: smtp.example.com gitlab_smtp_port: 465 diff --git a/roles/gitlab/templates/docker-compose.yml b/roles/gitlab/templates/docker-compose.yml index b594e07..357c020 100644 --- a/roles/gitlab/templates/docker-compose.yml +++ b/roles/gitlab/templates/docker-compose.yml @@ -22,8 +22,8 @@ services: web: image: docker.io/gitlab/gitlab-ce:{{ gitlab_version }} hostname: '{{ gitlab_domain }}' - mem_limit: 4500mb - memswap_limit: 5000mb + mem_limit: {{ gitlab_memory_limit }} + memswap_limit: {{ gitlab_memoryswap_limit }} environment: GITLAB_OMNIBUS_CONFIG: | external_url 'https://{{ gitlab_domain }}'