SLUG Mailing List Archives
Re: [SLUG] Increasing RAM
- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] Increasing RAM
- From: Daniel Pittman <daniel@xxxxxxxxxxxx>
- Date: Sun, 19 Apr 2009 10:51:02 +1000
- Organization: I know I put it down here, somewhere.
- User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux)
jam <jam@xxxxxxxxx> writes:
> On Sunday 19 April 2009 00:16:35 slug-request@xxxxxxxxxxx wrote:
>> I've decided to increase the RAM on my home CentOS server. As best I
>> can recall, the accepted wisdom is to have SWAP approx.~ 2 x RAM. Or
>> was that approx.~ 50% of RAM?
>> Can someone point me in the direction of an explicit tutorial on how
>> I might go about increasing SWAP without destroying data on my other
>> partitions please?
>> Or if I'm actually upping the RAM, should I just not worry about it?
>> Info I'm guessing would be relevant;
> Of course this is cockamany, urban myth, etc and typically you
> increase RAM and need even less swap than before
Actually, back in the day this was a good and solid guide, both for
performance and safety reasons. Today, less so, but I don't think it is
quite as laughable or untrue as you suggest.
> EXCEPT for 1 tragic circumstance: Never *suspend* unless you have as
> much SWAP as RAM.
You mean suspend to disk, not suspend to RAM, right? Swap is irrelevant
to the later, and the amount you need varies with which of the three
implementations of the former you choose.
However, all of them require as much swap as you have *active memory*,
not as much as RAM — although, obviously, if you have no discardable
pages then you need the two to be equal.
> Suspend writes all RAM starting at the beginning of swap and over
> everything along the way.
No, it doesn't. It uses the swap storage space just like the normal
kernel, except for adding some private accounting information and a
different header to make it possible to detect that it was used to
suspend to disk.
If it behaved as you describe then it would corrupt memory on the way
through as it overwrote swapped data (and, then, no one would ever
report a successful suspend to disk. :)
 You do, in the form of all executable code, disk backed memory
mappings, disk cache and so forth. In fact, it is quite rare that
discardable memory doesn't represent a substantial portion of your
used memory, even if swap is in use.
 Excluding the obvious circumstance of bugs in the suspend software
that cause it to create serious corruption, which you may have
encountered, especially with the more experimental versions.