1 |
Hello, |
2 |
|
3 |
(I'm CC-ing mirror admins since this may impact space consumption |
4 |
on mirrors, and gentoo-project to keep it public) |
5 |
|
6 |
As you may have noticed, I was playing with providing and efficiently |
7 |
updating SquashFS images for our users. A few notes of what has been |
8 |
decided so far: |
9 |
|
10 |
1. the SquashFS images would be LZO-compressed (with LZ4 switch planned |
11 |
when the kernels with it are spread enough), since it provides very |
12 |
good compression with great decompression speed and low requirements, |
13 |
|
14 |
2. the images would be updated through binary deltas made using |
15 |
xdelta3. |
16 |
|
17 |
3. since the deltas are quite space-inefficient, we won't be downloading |
18 |
a few day-to-day patches but instead a single combined patch for each |
19 |
supported day back. IOW, we would have: |
20 |
|
21 |
squashfs-20140127-20140128.delta |
22 |
squashfs-20140126-20140128.delta |
23 |
squashfs-20140125-20140128.delta |
24 |
squashfs-20140124-20140128.delta |
25 |
(...) |
26 |
|
27 |
Just to be clear, I don't want to replace the current snapshot+patch |
28 |
since it's more space-efficient. However, I'd like to provide |
29 |
an alternative for users for whom bandwidth is not a concern, but |
30 |
memory and/or time is. |
31 |
|
32 |
More details can be found in my article on SquashFS deltas [1]. |
33 |
|
34 |
|
35 |
I'd like to raise the following questions: |
36 |
|
37 |
1. Is infra@ ok with building the snapshots & deltas? |
38 |
|
39 |
2. Do our mirror admins have any concerns wrt this? |
40 |
|
41 |
3. How many days old snapshots do we want to support? That is, after |
42 |
how many days of not updating the user is supposed to download |
43 |
the whole new image rather than a patch? |
44 |
|
45 |
|
46 |
Now for the numbers: |
47 |
|
48 |
1) build server use: |
49 |
|
50 |
a) disk space: |
51 |
|
52 |
~100M for each snapshot (we need to keep the past snapshots |
53 |
for delta updates) |
54 |
|
55 |
6M-20M for early deltas, up to 40M for month-old delta |
56 |
|
57 |
likely no extra space requirements if we hack the update in .tar |
58 |
generation |
59 |
|
60 |
for 30 days backlog, I suspect around 3G for snapshots |
61 |
+ 1G for deltas |
62 |
|
63 |
b) memory: |
64 |
|
65 |
no noticeable impact |
66 |
|
67 |
c) CPU: |
68 |
|
69 |
LZO compression has relatively small impact |
70 |
|
71 |
around 7s heavy CPU use for xdelta3 (on i3 1.8 GHz) |
72 |
|
73 |
d) time: |
74 |
|
75 |
about 1 minute to build SquashFS |
76 |
|
77 |
for delta gen: ceil(n / c) * 7 seconds, |
78 |
where n = number of days, c = number of CPUs |
79 |
|
80 |
e) uplink bandwidth: |
81 |
|
82 |
mirrors will have to download all the deltas during sync, |
83 |
e.g. 1G every day |
84 |
|
85 |
2) mirror use: |
86 |
|
87 |
a) disk space: |
88 |
|
89 |
~100M for the snapshot (it's enough to mirror the latest one) |
90 |
|
91 |
6M-20M for early deltas, up to 40M for month-old delta |
92 |
|
93 |
for 30 days of backlog, I suspect around 1G |
94 |
|
95 |
b) uplink bandwidth: |
96 |
|
97 |
every switching user will download ~100M initial image |
98 |
|
99 |
users who sync daily will dl 6-10M every day |
100 |
|
101 |
users who sync often will dl 20-40M a week |
102 |
|
103 |
users who sync rarely will dl 40M-80M a month |
104 |
|
105 |
c) downlink bandwidth: |
106 |
|
107 |
depending on the no of days supported, for 30 days ~1G every day |
108 |
|
109 |
3) client impact |
110 |
|
111 |
a) disk space: |
112 |
|
113 |
~100M for current SquashFS (that is used by the package manager) |
114 |
|
115 |
during update, 10M-40M for the delta (depending on how outdated |
116 |
the image is) |
117 |
|
118 |
b) downlink bandwidth: |
119 |
|
120 |
10M-40M for the delta (for each update) |
121 |
|
122 |
c) memory & CPU: |
123 |
|
124 |
negligible |
125 |
|
126 |
d) time: |
127 |
|
128 |
fetching time + around 5 s for the update |
129 |
|
130 |
|
131 |
[1]:http://dev.gentoo.org/~mgorny/articles/using-deltas-to-speed-up-squashfs-ebuild-repository-updates.pdf |
132 |
|
133 |
-- |
134 |
Best regards, |
135 |
Michał Górny |