5

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.

Alejandro Piad
  • 151
  • 1
  • 4
  • Did you actually _try_ the answer given there? If not, go do that _first_. – Michael Hampton Jul 17 '14 at 23:32
  • Yes, there is only one answer, and it points to a Sidekiq config file. The thing is, this file is not in the Gitlab config folder, but in the Sidekiq config folder, which I don't have, because (I pressume) I didn't installed Sidekiq on my own. I assume it works if you have a standalone Sidekiq (whatever that means) and not embedded in Gitlab. – Alejandro Piad Jul 17 '14 at 23:39
  • 6
    Please note that SideKiq uses threads and `htop` shows threads as separate entries in output by default. Having 25 entries each showing 300MB of VIRT memory doesn't mean that SideKiq uses 25*300MB = 7.5GB of memory. If you switch to Tree View with F5 or hide threads with H you will see more real memory consumption. – AlexD Jul 18 '14 at 04:34
  • 1
    @AlexD that is a very good hint, I wasn't aware that `htop` shows separated threads. +1 for that. It makes me sleep a little better. In any case, if there is any hint on actually reducing the memory footprint, I'd be delighted to know. – Alejandro Piad Jul 21 '14 at 14:34

2 Answers2

6

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.

justinsg
  • 105
  • 2
  • Though this is not exactly an answer to the question, I found this immensely helpful! I did not know about gogs and after a first installation on my banana pi (!) seems rather promising. This seems like a drop-in replacement of gitlab written in go. :) – sschober Jul 29 '15 at 15:16
  • Nice but it really need the CI integration. – Wernight Apr 21 '16 at 19:58
6

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.

Jorge Tomas
  • 61
  • 1
  • 1