Use libeatmydata during LXC cache prep

The LXC cache prep is timing out regularly so use eatmydata to minimise
pressure on the filesystem during package installation.

dpkg calls fsync for each file installed from each package which can
result in very poor performance on some filesystems. This patch gives
around a 4x improvement in "slow" gate runs, and 2x on esxi hdd storage.

Change-Id: I1cc33a7647445cd2302e6ea6b9d78005262ebfa3
This commit is contained in:
Jonathan Rosser 2018-12-03 08:50:30 +00:00
parent 0766e893ec
commit 4d9491b83a

View File

@ -12,8 +12,11 @@ apt-get remove -y --purge snap* lxc* lxd* resolvconf* || true
# Update base distribution
apt-get update
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes gnupg
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes eatmydata
export LD_PRELOAD=/usr/lib/{{ ansible_architecture }}-linux-gnu/libeatmydata.so
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes gnupg
apt-get upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes
apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes {{ lxc_cache_distro_packages | join(' ') }}
apt-get upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes