Gentoo Archives: gentoo-amd64

From: Richard Freeman <rich@××××××××××××××.net>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] Re: System becomes almost unusable when compling c++ code
Date: Fri, 03 Aug 2007 19:54:45
Message-Id: 46B3872C.5070305@thefreemanclan.net
In Reply to: Re: [gentoo-amd64] Re: System becomes almost unusable when compling c++ code by Volker Armin Hemmann
1 Volker Armin Hemmann wrote:
2 > emm, from my very personal point of view: no
3 >
4 > swap is horrible slow. Its use must be avoided at any cost. Swap sucks.
5 > Everything is faster than accessing swap. So hitting the disk to read or
6 > write some files is IMHO better than hitting the disk to shove X into swap.
7 >
8 > X in swap is another problem. You can be sure, if X is forced into swap,
9 > because gcc uses up all ram for itself, everything sucks. Mouse is jerky,
10 > windows need ages to get displayed.
11 >
12
13 Depends - if you're not using X then you won't mind X getting swapped
14 (running emerge from ssh/etc). If you are using X then chance are it
15 won't get swapped in the first place. If the issue is gcc using all ram
16 for itself, then the presence/absence of tmpfs probably won't make much
17 difference - gcc still has to run.
18
19 I don't see why swap should be any better/worse than any other form of
20 disk access. If anything it is superior as it allows the kernel to
21 manage it like any other form of RAM, and the kernel isn't forced to
22 flush it out to disk within some time (writes to a filesystem are forced
23 to sync within some time to prevent data loss - this hurts performance
24 and is totally unnecessary for temporary build files that will get
25 deleted when you re-run emerge anyway).
26
27 Even if you don't have a tmpfs writing to disk will tend to drive unused
28 ram into swap - the system will swap idle memory to make room for
29 cache/buffers - where the recently-written files will reside in ram.
30
31 Now, in an extreme case where you have less RAM than the resident size
32 of the apps you have running then swap will be horrible - but that is
33 because you're continuously swapping in and out. And I doubt a tmpfs
34 will make much difference either way.
35
36 Now, if somebody has empirical data I'll certainly pay attention, or at
37 least a lot of expertise. However, I wouldn't jump to the conclusion
38 that swap is worse than ordinary disk writes - linux manages swap fairly
39 well all things considered. If you don't like how it is being managed
40 there are kernel settings that can be used to tweak it (swappiness, etc).

Attachments

File name MIME type
smime.p7s application/x-pkcs7-signature

Replies

Subject Author
Re: [gentoo-amd64] Re: System becomes almost unusable when compling c++ code Volker Armin Hemmann <volker.armin.hemmann@××××××××××××.de>
Re: [gentoo-amd64] Re: System becomes almost unusable when compling c++ code Bernhard Auzinger <e0026053@×××××××××××××××××.at>