Gentoo Archives: gentoo-user

From: gevisz <gevisz@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: /var/tmp on tmpfs
Date: Thu, 08 Feb 2018 21:53:06
Message-Id: CA+t6X7cAyoFUb+EfYyj++XgwBO53mVtr=3PUjwNdB4Wh9uBUgA@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: /var/tmp on tmpfs by Rich Freeman
1 2018-02-08 20:13 GMT+02:00 Rich Freeman <rich0@g.o>:
2 > On 08/02/18 19:11, gevisz wrote:
3 >>
4 >> I never used tmpfs for portage TMPDIR before and now decided to give it a
5 >> try.
6 >>
7 >> I have 8GB of RAM and 12GB of swap on a separate partition.
8 >>
9 >> Do I correctly understood
10 >> https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs
11 >> that I can safely set in the fstab the size of my tmpfs to 12GB so
12 >> that the chromium could be emerged in tmpfs (using the swap)
13 >> without the need to set notmpfs.conf for chromium and the likes.
14 >
15 > You can try it, but for Chromium these days you might find that still
16 > doesn't perform great. I have 16GB of RAM (no swap) and have moved
17 > back to building on SSD for that one package (with ccache to help).
18 >
19 > In an ideal world swap would STILL be better than building on disk,
20 > because it gives the kernel fewer constraints around what gets written
21 > to disk.
22
23 > Anything written to disk MUST end up on the disk within the dirty
24 > writeback time limit. Anything written to tmpfs doesn't ever have to
25 > end up on disk, and if it is swapped the kernel need not do it in any
26 > particular timeframe. Also, the swapfile doesn't need the same kinds
27 > of integrity features as a filesystem, which probably lowers the cost
28 > of writes somewhat (if nothing else after a reboot there is no need to
29 > run tmpreaper on it).
30
31 > So, swapping SHOULD still be better than building on disk, because any
32 > object file that doesn't end up being swapped is a saved disk IO, and
33 > the stuff that does get swapped will hopefully get written at a more
34 > opportune time vs forcing the kernel to stop what is doing after 30s
35 > (by default) to make sure that something gets written no matter what
36 > (if it wasn't deleted before then).
37
38 Thank you for the reply.
39
40 I probably try a pure tmpfs + swap solution. If it fails some day, I will
41 then add notmpfs exceptions.
42
43 However, it probably won't be sooner than
44 # emerge --update --deep --with-bdeps=y --newuse --backtrack=90 --ask
45 world --exclude chromium
46 fails because of the "--exclude chromium" part :), as I have already compiled
47 the recent vertion of chromium with /var/tmp/portage on the hard disk and
48 it took more than 24 hours on my old AMD Athlon X2 with j2 option. :(

Replies

Subject Author
Re: [gentoo-user] Re: /var/tmp on tmpfs Rich Freeman <rich0@g.o>