Gentoo Archives: gentoo-user

From: Daniel Troeder <daniel@×××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] PORTAGE_COMPRESS
Date: Thu, 03 Apr 2014 08:12:42
Message-Id: 533D17ED.7060309@admin-box.com
In Reply to: [gentoo-user] PORTAGE_COMPRESS by Douglas J Hunley
1 Am 02.04.2014 14:27, schrieb Douglas J Hunley:
2 > I was reviewing my Portage settings yesterday and I noticed that I have
3 > PORTAGE_COMPRESS set (to bzip2, the default) on both of my servers and
4 > it occurred to me that both of these servers have filesystems that
5 > support compression (btrfs on one, zfs on the other). So I'm wondering
6 > if it still makes sense to have PORTAGE_COMPRESS set or if I should
7 > unset it and just let the fs-level compression handle it. Portage is
8 > already slow, why have it take the time to do this when the fs does it
9 > better and transparently? Thoughts on the matter?
10 I think you have a good point disabling portage compression, but I
11 wanted to correct one statement: Decompression in the kernel takes as
12 much time as decompression in userspace - if it's the same algorithm.
13
14 The differences here are:
15 * creation of an additional process (bz[ip2, cat]), negligible compared
16 to the cpu time compression takes
17 * bz[ip2, cat] runs in user space (safer) vs in kernel space ("risky")
18 * different [de]compression algorithm (fs usually uses weaker but faster
19 compression algorithms like lz4, lzo or gz)
20 * different [de]compression setting (portage uses -9, kernel at best -6
21 - the difference in the resulting file size is small, but the difference
22 in used cpu time is high)
23
24 For me two things decide the question:
25 * Assuming you write more man pages than you read, and disk space is not
26 an issue, a weaker compression ratio to save cpu time makes sense.
27 * If you have compression _already_ on for the fs, then compressing
28 textual data before storing it on that fs is a waist of cpu time:
29
30 For example LZ4 will detect already compressed data (compression ratio
31 <12.5%), abort compression and store the file uncompressed. That's nice,
32 but it means that it has already compressed some blocks, before it could
33 measure it - waisting cpu time.
34
35 Greetings,
36 Daniel
37
38
39 --
40 Get my PGP key at:
41 *
42 http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x837FB8B5BB9D4887
43 * $ gpg --recv-keys --keyserver keyserver.ubuntu.com 0xBB9D4887

Attachments

File name MIME type
signature.asc application/pgp-signature