]> git.ipfire.org Git - ipfire-2.x.git/commit - make.sh
xz: Performance and compression tuning (V1)
authorMatthias Fischer <matthias.fischer@ipfire.org>
Sun, 20 May 2018 07:30:23 +0000 (09:30 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 21 May 2018 19:59:06 +0000 (20:59 +0100)
commit0d7a6f03d43994265a5c3a1d58be69ceecec9275
treea8e6d6be822e7b08c583d387080cb17405766f6d
parent814a7d126b461cf2a71dddb1a0e78e306e544233
xz: Performance and compression tuning (V1)

Hi,

as mentioned in the "list", we're trying to make the archives as small as possible
using 'xz'-compression.

In order to achieve this, this patch tests the size of the memory available on the
host system.

It sets the xz-memory-limit (--memory=[N]Mib) to 70% of the available working memory,
a maximum of four xz-'worker threads' (-T4) and a compression rate of '-8' (-8).

These options are written to the 'XZ_OPT=' environment.

For details see:
https://linux.die.net/man/1/xz

I have set the number of available xz-'worker threads' (-T) to four (-T4), because during
the final tests the '-T0' parameter led to error messages snd stopped: 'cannot allocate memory'.
It wouldn't even run with 90%.

Furthermore, testing with '-T0' led to countless messages filling  up '_build.packages.log'.

E.g.:
...
xz: Adjusted the number of threads from 8 to 2 to not exceed the memory usage
limit of 1557 MiB
...

Tests took place on a 32bit-Ubuntu 16.04.4-system with 8 GB RAM and an Intel I7-2600.
Build time was about 04:30 hrs. Perhaps a 64bit-system would perform better (higher
values), but my goal was to make this run on as many systems as possible, so I choosed
these averages.

If minimum requirements (1024 MB RAM) are not met, building stops.

Current results:

'next', untuned:
ipfire-2.19.2gb-ext4.i586-full-core121.img.gz => 332951687 Bytes
ipfire-2.19.i586-full-core121.iso => 228589568 Bytes

'next', XZ_OPT: -T4 -8, 70% RAM:
ipfire-2.19.2gb-ext4.i586-full-core121.img.gz => 329725723 Bytes
ipfire-2.19.i586-full-core121.iso => 217055232 Bytes

These two resulting archives are 14760300 Bytes smaller than before.

Best,
Matthias

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/Config
lfs/cdrom
make.sh