These tools are used to show collect information on performance and cost of a 'apt-get update'.
You need to have chdist
from devscripts
package to use it.
The results shown here are on a cloud with a local mirror, so latency is low and bandwidth high.
Collect some data for runs of both 'cloud' and 'cd' modes. This will call test-archive-update multiple times and copy out the output to out.d.
$ ./collect-data out.d
Then summarize show some information on what all happened. This shows the HTTP status code for each GET that apt did and how much data was downloaded. The output format is the stderr output of apt-update -q -o Debug::Acquire::http=1
.
$ ./summarize-http out.d/cloud/clean/update.err
...
data bytes: 14431826
total GETS: 27
200: 16
404: 11
$ ./summarize-http out.d/cloud/noclean/update.err
...
data bytes: 0
total GETS: 27
304: 16
404: 11
$ ./summarize-http out.d/cd/clean/update.err
...
data bytes: 14893753
total GETS: 58
200: 37
404: 21
$ ./summarize-http out.d/cd/noclean/update.err
...
data bytes: 0
total GETS: 58
304: 37
404: 21
In the examples above 'cloud' represents the old cloud apt sources.list, which did not contain restricted or multiverse or backports. The big thing to notice is that every apt-get update
ends up doing the same amount of GETS. Many of them are 'If-Modified-Since
' requests and an unmodified response (304).
Also to note as significant is the number of 404. These http stat
operations are also expensive.
On Jan 19, 2016 on xenial (1.1.10) I noticed that 'apt-get update' was only getting InRelease files and seemed to not be doing an obscene amount of GETs either. See below for improvements:
$ ./collect-data out.d xenial
$ for e in ./out.d/*/*/update.err; do echo == $e ==; ./summarize-http $e; done > out; grep -v '^[^[]' out
== ./out.d/cd/clean/update.err ==
data bytes: 7595517
total GETS: 7
200: 7
== ./out.d/cd/noclean/update.err ==
data bytes: 0
total GETS: 4
304: 4
== ./out.d/cloud/clean/update.err ==
data bytes: 7522001
total GETS: 6
200: 6
== ./out.d/cloud/noclean/update.err ==
data bytes: 0
total GETS: 3
304: 3