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; }
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 apt/lists/ . This is reasonable, versus a full 'apt-get clean', as
/var/lib/
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 apt/lists/ *; do case "$f" in (*-updates*) rm -f "$f";; esac; done; }
% clean() { for f in /var/lib/
% 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)' nova.clouds. archive. ubuntu. com trusty InRelease nova.clouds. archive. ubuntu. com trusty-updates InRelease [64.4 kB] nova.clouds. archive. ubuntu. com trusty Release.gpg nova.clouds. archive. ubuntu. com trusty Release nova.clouds. archive. ubuntu. com trusty-updates/main amd64 Packages [635 kB] nova.clouds. archive. ubuntu. com trusty- updates/ universe amd64 Packages [323 kB] nova.clouds. archive. ubuntu. com trusty/main amd64 Packages nova.clouds. archive. ubuntu. com trusty/universe amd64 Packages security. ubuntu. com trusty-security InRelease security. ubuntu. com trusty- security/ main amd64 Packages security. ubuntu. com trusty- security/ universe amd64 Packages
Ign http://
Get:1 http://
Hit http://
Hit http://
Get:2 http://
Get:3 http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
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 nova.clouds. archive. ubuntu. com trusty InRelease nova.clouds. archive. ubuntu. com trusty-updates InRelease [64.4 kB] nova.clouds. archive. ubuntu. com trusty Release.gpg nova.clouds. archive. ubuntu. com trusty Release 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] nova.clouds. archive. ubuntu. com trusty-updates/main amd64 Packages [635 kB] security. ubuntu. com trusty-security InRelease nova.clouds. archive. ubuntu. com trusty- updates/ universe amd64 Packages [323 kB] nova.clouds. archive. ubuntu. com trusty-updates/main Translation-en [308 kB] nova.clouds. archive. ubuntu. com trusty- updates/ universe Translation-en [170 kB] nova.clouds. archive. ubuntu. com trusty/main Sources nova.clouds. archive. ubuntu. com trusty/universe Sources nova.clouds. archive. ubuntu. com trusty/main amd64 Packages nova.clouds. archive. ubuntu. com trusty/universe amd64 Packages nova.clouds. archive. ubuntu. com trusty/main Translation-en nova.clouds. archive. ubuntu. com trusty/universe Translation-en security. ubuntu. com trusty- security/ main Sources nova.clouds. archive. ubuntu. com trusty/main Translation-en_US nova.clouds. archive. ubuntu. com trusty/universe Translation-en_US security. ubuntu. com trusty- security/ universe Sources security. ubuntu. com trusty- security/ main amd64 Packages security. ubuntu. com trusty- security/ universe amd64 Packages security. ubuntu. com trusty- security/ main Translation-en security. ubuntu. com trusty- security/ universe Translation-en
Ign http://
Get:1 http://
Hit http://
Hit http://
Get:2 http://
Get:4 http://
Hit http://
Get:5 http://
Get:6 http://
Get:7 http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Ign http://
Ign http://
Hit http://
Hit http://
Hit http://
Hit http://
Hit http://
Fetched 1,881 kB in 4s (447 kB/s)
Reading package lists...
real 0m6.648s
user 0m4.888s
sys 0m0.243s