Optimization of high memory usage for GitLab CE
Asked Answered
A

1

8

I have deployed Gitlab CE on my private server in Docker container. There are 5 users, 1 project (1GB) and nothing else, no CI/CD, no background tasks. We are using it just as a GIT repository.

It is currently taking 4.5GB RAM and it seems to be too much for this purpose:

671MB puma: cluster worker 0: 23227
639MB puma: cluster worker 1: 23227
604MB puma 4.3.3.gitlab.2 (unix:///var/opt/gitlab/gitlab-rails/sockets/gitlab.socket...
572MB sidekiq 5.2.9 queues:authorized_project_update:...
2338MB /opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby

I have made following changes to the configuration:

puma['worker_processes'] = 2
puma['min_threads'] = 1
puma['max_threads'] = 4
sidekiq['concurrency'] = 9
prometheus['enable'] = false

I would welcome any advice for the optimization. Thank you,

Analogical answered 23/9, 2020 at 11:55 Comment(0)
J
12

I was having similar issues..

I found that the following three lines dropped my memory usage by a bit over 80%.

puma['worker_processes'] = 0
prometheus_monitoring['enable'] = false
sidekiq['max_concurrency'] = 10

There is also a helpful page which has a bunch of further suggestions like optimising gitaly, and there's some ready to go config at the bottom.

https://docs.gitlab.com/omnibus/settings/memory_constrained_envs.html

Jolo answered 6/5, 2021 at 6:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.