Make apt-get install run faster for deploys
It takes a long time to do a deploy since all workers have to run apt-get install
. Pre-downoading the .deb might save a few seconds. The bulk of the time is spent unpacking the file. Here'a script that simulates what apt-get does:
ar x gitlab-ee_8.11.0-rc2.ee.1_amd64.deb
tar xzf control.tar.gz
tar xzf data.tar.gz
$ time ./unpack.sh
real 0m21.007s
user 0m11.012s
sys 0m10.346s
I tried using pigz to make things go faster:
export TAR_OPTIONS="--use-compress-program=pigz"
ar x .gitlab-ee_8.11.0-rc2.ee.1_amd64.deb
tar xf control.tar.gz
tar xf data.tar.gz
It saves a few seconds, but it seems to me the majority of the time is still spent on disk access:
$ time ./unpack.sh
real 0m17.099s
user 0m8.158s
sys 0m11.932s
```
There is a tool called apt-fast (http://xmodulo.com/speed-slow-apt-get-install-debian-ubuntu.html), but I think this only speeds the initial download and will still be bottlenecked by filesystem access.
Another solution would be for us to create a delta package so that only the changed files somehow get updated.