Reduce Gitlab memory footprint
I'm currently running both a Gitlab instance (v6.7.3) and a Ghost-powered personal blog on a DigitalOcean VPS with 512mb (lowest end), served by nginx. Until just recently I was unable to run both, because Gitlab failed to start, complaining about low memory. I solved the problem (at least temporary) by enabling swap on the VPS (1GB). The main issue seems to be that Gitlab spawns 25 (!) instances of Sidekiq, each of which takes up about 30% of my memory, as shown in htop
. I found a question here on SF about configuring Gitlab for using less Sidekiq workers, but it didn't get an accepted response.
My question is: what is the configuration for running Gitlab with the lowest possible memory footprint? Maybe I cannot reduce those 25 Sidekiq workers, but I can do something else to reduce its memory footprint.
My VPS is for private use only, I have 5 or 6 projects on my Gitlab, and expect at most 5 or 6 commits a day, so the lightest possible configuration that actually works is good enough for me. My blog also has very few hits.
Solution 1:
I use Gogs now, to keep my projects, is not as full featured as GitLab, but for my projects is more than enough, it's super lightweight and it doesn't require setup, only a initial configuration.
Solution 2:
You can use this configuration in your gitlab.rb
sidekiq['concurrency'] = 1 #25 is the default
unicorn['worker_processes'] = 1 #2 is the default
That should reduce your memory consumption.