gitlab: Optimize raw blob downloading
authorKirill Smelkov <kirr@nexedi.com>
Fri, 8 Jan 2016 11:24:53 +0000 (14:24 +0300)
committerKirill Smelkov <kirr@nexedi.com>
Sun, 17 Jan 2016 21:46:00 +0000 (00:46 +0300)
commita913c2e425af5da40042179d367649de2e859258
tree7a58161b13cdd655fc7e716c73ff7372fe679509
parent74d4ea62abb9cc42bc694f7c1812050589da0beb
gitlab: Optimize raw blob downloading

In slapos we do a lot of automated software rebuild constantly, and thus
there is constant flow of requests to get raw blobs from git service,
e.g. like this

    https://lab.nexedi.com/nexedi/slapos/raw/master/software/wendelin/software.cfg

A lot of requests comes to slapos.git repository and currently gitlab,
out of the box, cannot keep up with that load.

I've prepared patches to offload raw blobs download requests handling
from unicorn (ruby) to gitlab-workhorse (go), and that resulted in ~ 17x
speedup - e.g. previously our std shuttle can handle ~ 70 raw-blob
requests/s and with my changes it is now ~ 1200 requests/s.

The patches were sent upstream

    https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/17

and we discussed with GitLab people and made a plan how to proceed
incrementally. It will probably take some time for gitlab team to fully
accept the approach though.

For now we can use our gitlab-workhorse fork. The patches itself are:

    https://lab.nexedi.com/kirr/gitlab-workhorse/commit/1b274d0d
    https://lab.nexedi.com/kirr/gitlab-workhorse/commit/2beb8c95

/cc @kazuhiko, @jerome, @jm
software/gitlab/software.cfg
software/gitlab/template/nginx-gitlab-http.conf.in