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
This commit is contained in:
Sheogorath 2021-05-08 02:13:51 +02:00 committed by saibotk
parent 9cc64920a3
commit ab6570dc9e
Signed by: saibotk
GPG key ID: 67585F0065E261D5

View file

@ -176,6 +176,15 @@ services:
{% endif %} {% endif %}
{% 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: labels:
- "traefik.http.routers.gitlab.rule=Host(`{{ gitlab_domain }}`) && PathPrefix(`/`)" - "traefik.http.routers.gitlab.rule=Host(`{{ gitlab_domain }}`) && PathPrefix(`/`)"
- "traefik.http.routers.gitlab.entrypoints=websecure" - "traefik.http.routers.gitlab.entrypoints=websecure"