Code review comment for lp:~smoser/curtin/trunk.no-translations

Revision history for this message
Scott Moser (smoser) wrote :

To show the improvement here, just run a test. Note, this is on
a cloud with a local mirror, so bandwidth is high and latency low.

The difference shown below is:
download: 1023 kB -> 1881 kB
time: 4.7s -> 6.6s
http connections: 11 -> 25 (both GET and stat)
http GET: 3 -> 7

We basically clean out to clean out all '-updates' things in
/var/lib/apt/lists/. This is reasonable, versus a full 'apt-get clean', as
during the life of a stable release, the 'trusty' pocket wont change, but
at any point after initial media create, you're probably out of date
on the trusty-updates things. Note, a full 'apt-get clean' would mean
we'd download the 'trusty' pocket things again, so both cases would just
have additional number of downloads.

## make sure you're up to date lists on everything, then clean out updates
% clean() { for f in /var/lib/apt/lists/*; do case "$f" in (*-updates*) rm -f "$f";; esac; done; }
% reset() { apt-get update --quiet >/dev/null 2>&1; clean; }

% reset; time python -c 'from curtin.util import apt_update; apt_update(target="/", force=True)'
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:1 http://nova.clouds.archive.ubuntu.com trusty-updates InRelease [64.4 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:2 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [635 kB]
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [323 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Fetched 1,023 kB in 2s (495 kB/s)
Reading package lists...

real 0m4.731s
user 0m2.670s
sys 0m0.194s

% reset; time apt-get update --quiet
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:1 http://nova.clouds.archive.ubuntu.com trusty-updates InRelease [64.4 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:2 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [240 kB]Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [140 kB]
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [635 kB]
Hit http://security.ubuntu.com trusty-security InRelease
Get:5 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [323 kB]
Get:6 http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en [308 kB]
Get:7 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en [170 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Hit http://security.ubuntu.com trusty-security/main Sources
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Fetched 1,881 kB in 4s (447 kB/s)
Reading package lists...

real 0m6.648s
user 0m4.888s
sys 0m0.243s

« Back to merge proposal