High memory usage for Gitlab CE

delmalki picture delmalki · Mar 21, 2016 · Viewed 36.1k times · Source

Look at this picture showing gitlab ce memory consumption. gitlab ce memory consumption

I really dont need all of those workers, sidekiq or unicorn or all of those daemon. This is on IDLE. I mean, I installed this to manage 1 project, with like 4 people, I dont need all those daemon. Is there any way to reduce this ?

Answer

René Link picture René Link · May 31, 2017

I also had problems with gitlab's high memory consumption. So I ran the linux tool htop.

In my case I found out that the postgresl service used most of the memory.

With postgres service running 14.5G of 16G were usedenter image description here

I stopped one gitlab service after the other and found out that when I stop postgres a lot of memory was freed.

enter image description here

You can try it

gitlab-ctl stop postgresql

and start the service again with

gitlab-ctl start postgresql

Finally I came across the following configuration in /etc/gitlab/gitlab.rb

##! **recommend value is 1/4 of total RAM, up to 14GB.**
# postgresql['shared_buffers'] = "256MB"

I just set the shared buffers to 256MB by removing the comment #, because 256MB is sufficient for me.

postgresql['shared_buffers'] = "256MB"

and executed gitlab-ctl reconfigure. gitlab-ctl restarts the affected services and the memory consumption is now very moderate. enter image description here

Hopefully that helps someone else.