Gentoo Archives: gentoo-amd64

From: Volker Armin Hemmann <volker.armin.hemmann@××××××××××××.de>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] tmpfs help
Date: Wed, 13 Feb 2008 16:18:02
Message-Id: 200802131717.57766.volker.armin.hemmann@tu-clausthal.de
In Reply to: Re: [gentoo-amd64] tmpfs help by Richard Freeman
1 On Mittwoch, 13. Februar 2008, Richard Freeman wrote:
2 > Volker Armin Hemmann wrote:
3 > > On Mittwoch, 13. Februar 2008, Richard Freeman wrote:
4 > >> Do you have benchmarks to support this?
5 > >
6 > > which numbers? that swap is horrible slow compared to ram?
7 >
8 > No - that compiling in tmpfs is horrible compared to compiling to disk.
9 > Neither of us is proposing getting rid of disk access entirely - we're
10 > just debating two different ways of doing it.
11
12 tmpfs is fine - if you have enough ram. 1gb is not enough.
13
14
15
16 > >> As opposed to wasting all your RAM on cache&buffers to hold all those
17 > >> files being accessed? During compilation that RAM is going to be
18 > >> heavily used - no getting around that. Once you're done any files left
19 > >> sitting on a tmpfs will just get paged out until accessed. They
20 > >> shouldn't really use any RAM at all. Even if those files were on disk
21 > >> they would consume RAM in the form of caching until they're considered
22 > >> unneeded.
23 > >
24 > > cached&buffered information can be discarded anytime if the ram is needed
25 > > elsewhere. tmpfs has to be shoved into swap.
26 >
27 > Uh, data written to a file has to be written to disk before the
28 > cache/buffer is flushed. The difference is that the data is written to
29 > disk within about 10 seconds of being written to the buffer, and then
30 > retained in cache maybe for a few hours longer (optimistically). With
31 > tmpfs the write doesn't happen until the space is needed. Either way
32 > every byte gets written - with tmpfs it is deferred as late as possible
33 > but with disk-based filesystems the write is done as early as possible.
34 >
35
36 emm, no.
37
38
39 > > Extreme example?
40 > >
41 > > kdepim with the enablefinal flag. On amd64 every single gcc instance
42 > > needs ~900mb at two points of compilation. With 1gb ram and no tmpfs it
43 > > sucks.
44 > >
45 > > With 1gb ram and 512mb of that reserved for tmpfs, you'll get a
46 > > swapstorm.
47 >
48 > Oh, it will certainly swap a great deal. However, I don't see why it
49 > would be any slower - either way you're doing a ton of disk access. Do
50 > you have actual benchmarks?
51
52 Not real benchmarks. But kdepim with enablefinal, 1gb of ram and -j2 several
53 hours. With j1 2h.
54 .
55 kdepim with 2gb of ram and j2 30m
56 Just because first case swap storn, last case no swap at all.
57
58 >
59 > Again, tmpfs doesn't "reserve" memory - it uses memory - just like
60 > cache/buffers.
61
62 but while cache/buffers can be discarded when the ram is needed, tmpfs has to
63 be shoved into butt-slow swap.
64
65 >
66 > >> I certainly agree that
67 > >> swap is slow compared to RAM, but it isn't slow compared to a disk-based
68 > >> filesystem.
69
70 yes, yes it is. It is faster to start an app from disk, then to fetch it out
71 of swap. My very personal experience since many many years.
72
73
74 > >
75 > > really? Every really swapped? IMHO it feels like every single byte is
76 > > fetched by a mule.
77 >
78 > Right now I've got 589MB of free RAM (-/+ buffers/cache) with 2GB of RAM
79 > total. I've got 705MB of swap used. Works just fine IMHO. Sure, if I
80 > make it really busy it can get slow, although with nice/ionice there
81 > isn't much visible
82
83 your system would feel and act a lot faster if you don't have anything in
84 swap. 'Fine' is good - as long as you don't know the alternative.
85
86 > > Of course adding more RAM will never hurt, but that incurs
87 > >
88 > >> significant cost and you can at least maximize your current hardware
89 > >> before investing in more of it.
90 > >
91 > > significant costs like 30euros for 2gb?
92 >
93 > Sure. Compared to about $1 for 2GB of hard drive space 30 euros is
94 > significant.
95
96 don't forget that ram is also roughly 100 times faster than harddisk.
97
98 > And even if he had 2GB of RAM I submit that it would
99 > probably work better if he compiled in tmpfs than on disk.
100
101 with 2gb he could do it. But with 1gb he just hurts himself.
102
103
104 > There is no
105 > question that a $550 computer will outperform a $500 computer, and a
106 > $600 computer will outperform a $550 computer, and so on. You can
107 > always spend 30 more euros and improve your system. What I'm interested
108 > in is maximizing the performance of the system I have now. I can always
109 > spend $50 and make it even faster. However, there are lots of things I
110 > can spend $50 on - I'd rather spend it on something else all things
111 > being equal.
112
113 you could stop shoving everything in swap - no costs involved and system is a
114 lot faster.
115
116
117 --
118 gentoo-amd64@l.g.o mailing list

Replies

Subject Author
[gentoo-amd64] Re: tmpfs help Duncan <1i5t5.duncan@×××.net>
Re: [gentoo-amd64] tmpfs help Richard Freeman <rich@××××××××××××××.net>