From 4d9491b83ad49ef84a3ff4719aca37b44cf54b08 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Mon, 3 Dec 2018 08:50:30 +0000 Subject: [PATCH] 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 --- templates/prep-scripts/ubuntu_18_prep.sh.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/prep-scripts/ubuntu_18_prep.sh.j2 b/templates/prep-scripts/ubuntu_18_prep.sh.j2 index bf7e5a65..3b4b1c5e 100644 --- a/templates/prep-scripts/ubuntu_18_prep.sh.j2 +++ b/templates/prep-scripts/ubuntu_18_prep.sh.j2 @@ -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