From ab6570dc9ee69f183d114c46dcb2ae84d4b38ec1 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sat, 8 May 2021 02:13:51 +0200 Subject: [PATCH] gitlab: Reduce log retention drastically This patch instructs gitlab's omnibus image to configure logging to only retain 5 files for each services which are not larger than 10MiB or older than a day (default rotation time). This should help to prevent random crashes/becoming unhealthy, which seems to originate from a filled up tmpfs for logging. Reference: https://docs.gitlab.com/13.11/omnibus/settings/logs.html#runit-logs --- roles/gitlab/templates/docker-compose.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/roles/gitlab/templates/docker-compose.yml b/roles/gitlab/templates/docker-compose.yml index d5b6440..da86bca 100644 --- a/roles/gitlab/templates/docker-compose.yml +++ b/roles/gitlab/templates/docker-compose.yml @@ -176,6 +176,15 @@ services: {% endif %} {% endif %} +{% if gitlab_log_tmpfs %} + # Configure logging to only retain 10 log files, of 10MiB each + # This should prevent the tmpfs from overflowing + logging['svlogd_size'] = 10 * 1024 * 1024 + logging['svlogd_num'] = 5 + logging['logrotate_maxsize'] = 10 * 1024 * 1024 + logging['logrotate_rotate'] = 5 +{% endif %} + labels: - "traefik.http.routers.gitlab.rule=Host(`{{ gitlab_domain }}`) && PathPrefix(`/`)" - "traefik.http.routers.gitlab.entrypoints=websecure"