High RAM usage

(I’m new here, sorry if this isn’t the right section)

Hi, just installed the gitlab-ce docker container, and for some reason it is using huge amounts of RAM (8.452GB as reported by docker stats). I just set up the server and have only one account and no code. Is this normal? Is there a way to reduce the amount of RAM used?

Anyone?

Here!

I’ve got the same problem.

Using the latest docker and latest gitlab/gitlab-ce image.

I can’t believe it is supposed to do so.
if i can’t find a way to fix this/reduce the memory consumption, i have to delete the container.

Did you find a solution so far?

Hi,

does the memory usage affect the performance of GitLab or the server itself? I could imagine that memory is virtually reserved. Please share the output of top or htop.

Cheers,
Michael

Hello,

thank you for your reply.

docker stats gitlab shows me:

CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM %
747cb282fa71 gitlab 3.50% 11.63GiB / 31.43GiB 37.02%

And htop:

Mem: 16.9G/31.4G, where almost the complete right half (the unused 16G) is orange/reserved.

If i stop the gitlab container, Mem goes down to ~3,5G, same with reserved.

And, it is not a single or a few processes of gitlab consuming that much Mem, it is an enormous amount of processes taking a bit each. (dozens of unicorn-workers, sidekiq and prometheus… )
Don’t want to count them, but if the numbers in brackets are continuous, more than 50.

regards

I have used the following parameters in docker-compose.yml to optimize RAM usage:

environment:
  GITLAB_OMNIBUS_CONFIG: |
    external_url 'https://gitlab.example.si'

    # Memory optimizations for constrained environments
    puma['worker_processes'] = 0
    prometheus_monitoring['enable'] = false
    sidekiq['max_concurrency'] = 10
    gitlab_pages['enable'] = false

It helped me reduce the RAM usage from 9GB to 2.5 GB on a freshly deployed Docker container, as well as the I/O usage, which was ridiculously high for an empty new instance.

More information available here: https://docs.gitlab.com/omnibus/settings/memory_constrained_envs/

That definitely helps, but 2.5 GB is still a lot for something just deployed with zero repositories, let alone the ridiculous 8 mentioned above. I get GitLab is supposed to scale, but part of scaling is also being able to downscale down to practically no resource usage at all if none is required. I can only imagine this is due to a ton of workers, each which have massive memory buffers allocated for caching or whatnot being created “just in case its needed”. Just feels like a massive copout to me, but I suppose if the enterprise customers don’t have an issue with it then it’s not a big deal at all. Just wanted to share my sentiment.