Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] SSDs, swap, caching, other unusual uses
Date: Sun, 31 Jul 2011 14:46:19
Message-Id: CA+czFiC4QCbA2VDH_K1e49c5jDBFO3EWDQsQPbMwTy9=uTavag@mail.gmail.com
In Reply to: Re: [gentoo-user] SSDs, swap, caching, other unusual uses by Volker Armin Hemmann
1 On Sun, Jul 31, 2011 at 10:02 AM, Volker Armin Hemmann
2 <volkerarmin@××××××××××.com> wrote:
3 > On Friday 29 July 2011 14:18:41 Michael Mol wrote:
4 >> Something that's been tickling my brain for a couple years now, and
5 >> you guys are probably the right ones to ask.
6 >>
7 >> I haven't dropped coin for an SSD (yet), but I was wondering about
8 >> uses for them beyond using them for / or /home.
9 >>
10 >> 1) What about sitting swap (partition, file, whatever) on the SSD?
11 >
12 > NO!
13 >
14 > For $DEITY's sake- NO!
15 >
16 > ssds can't withstand many writes (yeah, I know, millions blablabla... earlier
17 > done than you think). Do Not Do This.
18 >
19 > SSDs are not meant for such a scenario.
20
21 I'm not one to care what a tool was meant for, only what it can be used for.
22
23 While I take your point about write-cycle limitations, and I would
24 *assume* you're familiar with the various improvements on
25 wear-leveling technique that have happened over the past *ten years*
26 since those concerns were first raised, I could probably raise an
27 argument that a fresh SSD is likely to last longer as a swap device
28 than as a filesystem.
29
30 Swap is only touched as-needed, while there's been an explosion in
31 programs and user software which demands synchronous writes to disk
32 for data integrity purposes. (Firefox uses sqlite in such a way, for
33 example; I discovered this when I was using sqlite heavily in my *own*
34 application, and Firefox hung for a couple minutes during every batch
35 insert.)
36
37 Also, despite the MBTF data provided by the manufacturers, there's
38 more empirical evidence that the drives expire faster than expected,
39 anyway. I'm aware of this, and not particularly concerned about it.
40
41 >
42 >> Presumably, in scenarios where expanding the RAM in a system is
43 >> prohibitively expensive, an SSD could reduce the impact of swap
44 >> thrash.
45 >
46 > no, it is increasing the impact of SSD trash.
47
48 False dichotomy. Yes, it increases the wear on the device. That says
49 nothing of its impact on system performance, which was the nature of
50 my point.
51
52 >
53 >> 2) While my system rarely goes above using 2-2.5GB of RAM, I enjoy
54 >> having 6-8GB of RAM, just for the file cache. Of course, I lose that
55 >> when I reboot; the cache needs to be repopulated. Has there been any
56 >> work in the kernel for doing things like Vista/Win7's ReadyBoost?
57 >> ReadyBoost has a ridiculous limit to only using 4GB of a flash drive,
58 >> but I'd think that an 80GB SSD would be a massive performance
59 >> improvement.
60 >>
61 >
62 > with a SSD filecache is not that important anymore - and every usb-stick is
63 > slower than a SSD.
64
65 I'll poke the second argument first. I wouldn't use USB for something
66 like this. USB2 is a painfully slow polling architecture. Something
67 like this would need to be done with SATA. I'm *not* that daft.
68
69 As for a filecache not being that important, that's only the case if
70 your data of interest exists on the filesystem you put on the SSD.
71
72 Let's say you're someone like me, who would tend to go with 60GB for /
73 and 3TB for /home. At various times, I'll be doing HDR photo
74 processing, some video transcoding, some random non-portage compile
75 jobs, web browsing, coding, etc.
76
77 If I take a 160GB SSD, I could put / (or, at least, /var/ and /usr),
78 and have some space left over for scratch--but it's going to be a pain
79 trying to figure out which of my 3TB of /home data I want in that fast
80 scratch.
81
82 File cache is great, because it takes caches your most-used data from
83 *anywhere* and keeps it in a fast-access datastore. I could have a 3
84 *petabyte* volume, not be particularly concerned about data
85 distribution, and have just as response from the filecache as if I had
86 a mere 30GB volume. Putting a filesystem on an SSD simply cannot scale
87 that way.
88
89 Actually, this conversation reminds me of another idea I'd had at one
90 point...putting ext3/ext4's journal on an SSD, while keeping the bulk
91 of the data on large, dense spinning platters.
92
93 >
94 >> Obviously, for something like Gentoo, putting an SSD-based filesystem
95 >> under /var/tmp makes a lot of sense, but what other uses have been
96 >> tried? How'd they work out?
97 >
98 > no, /var/tmp is very not important from a performance point of view - with the
99 > exception of /var/tmp/portage - and that is a candidate for tempfs.
100
101 Did you miss the last week's worth of discussion of memory limits on tmpfs?
102
103 --
104 :wq

Replies

Subject Author
Re: [gentoo-user] SSDs, swap, caching, other unusual uses Volker Armin Hemmann <volkerarmin@××××××××××.com>