Re: swap size for 2gb 2 processors?



ray wrote:
On Thu, 21 Dec 2006 04:58:21 -0900, Floyd L. Davidson wrote:

General Schvantzkoph <schvantzkoph@xxxxxxxxx> wrote:
On Thu, 21 Dec 2006 11:22:22 +0000, Ron Hardin wrote:

How big should I partition swap for 2gb ram 2 processors? Planning
out a partition magic run on a 120 gb disk, sharing with windows XP.

The rule of thumb is 2 * RAM size, in your case that would be 4G. This is
There is no such rule of thumb for Linux, and *never* has been.
Use Google and learn something about it before you post false
statements.


Do you know what a 'rule of thumb' is? In days past, there was indeed a
rule of thumb if not a hearty recommendation for swap = 2*physicalRAM.
This was in the day before 1gb was fairly common, but indeed, it was there.

The rule came from way back when swapping meant what it said. When a process
was sleeping and memory was needed, the entire process was copied to disk.
Disk space was allocated at process creation. So there had to be at least
enough disk space for all running processes to run the system at all. Now to
get any use from the swapping feature, there had to be more space than that,
so someone figured the 2x rule of thumb. 2 was probably chosen because if
you needed to swap more than that, you were in big trouble anyway due to
memory shortage. Trouble was, in those days, you could not add anymore
memory (typically 124 KBytes).

Current versions of UNIX and AFAIK all versions of Linux do not swap at all;
they page; i.e., they write out the least recently used pages in an attempt
to keep just the working set in memory. So if the old criterea applied, the
rule of thumb for Linux systems would be 1x the amount of memory for paging
disk space (still called swap space for historical reasons). But my
experience (and your guess is as good as mine if it is typical) is that the
more RAM you have, the less "swap space" you need and for the way I run, 8
GBytes (32-bit machine) is such that no paging has occurred in the last 61 days.

--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ PGP-Key: 9A2FC99A Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 14:35:01 up 61 days, 17:06, 3 users, load average: 4.33, 4.15, 4.10
.



Relevant Pages

  • Re: mdconfig unable to allocate memory
    ... > one ensure that all the memory is being used for suitable file caching ... > disk, really; I assumed that it would immediately start dumping ... > anything I put in it, into swap, causing disk access. ... file system with 4GB of RAM without a problem, ...
    (freebsd-current)
  • [PATCH 0/4] compcache: compressed in-memory swapping
    ... It creates RAM based block devices which can be used as swap disks. ... Pages swapped to this device are compressed and stored in memory itself. ... these suffer from wear-leveling issues when used as swap disk ... exposes *bottlenecks* in ramzswap code due to which this gain ...
    (Linux-Kernel)
  • Re: Cannot print any Word docs after upgrading to OS X 10.4.9
    ... It does not hurt, but, on a machine with plenty of memory, it would not ... the system creates swap files to deal with those awkward moments ... will page out a few megabytes of Word's working memory to disk and let ... Each one after the first 64MB swapfile0 doubles the total swapfile ...
    (microsoft.public.mac.office.word)
  • Re: Q: How much Swap space?
    ... > plenty of unused physical memory. ... > discarding more frequently used disk cache. ... The only "bad" thing about not having used any swap, IMHO, is that I have ...
    (alt.os.linux.suse)
  • Re: swap_pager complaints but not using swap
    ... using a whole 96K of swap. ... I don't see any disk related ... Traditionally swap used the b partition. ... virtual memory support. ...
    (freebsd-questions)