[sclug] Newbie, partitioning 120Gb HDD - recommendations?

Tom Dawes-Gamble tmdg at tmdg.co.uk
Mon Jan 17 22:32:33 UTC 2005


On Mon, 2005-01-17 at 11:34 +0000, David Newcomb wrote:

>  Swap size should be 2 or 3 times the size of phyical memory.

Back in the distant past it used to be that, before you could start a
process you have to have enough swap free to accommodate the initial
requirements of the process.  This was based on the fact that to grow a
process it had to be swapped out and then swapped in to the larger bit
of memory.  With page based systems you don't really need to do that any
more.

Swap needs to be large enough to hold any pages that can't be held in
memory.  Though I think that text pages are never swapped that are just
discarded and then re-loaded from the binary.  

So lets say you have a memory requirement for all your processes that
adds up to 1Gig If you have a 512 Meg system you need swap to be memory
times 2 if on the other hand you only have 256 meg you need a swap of
memory time 4.

On some system such as HP-UX they use a thing called pseudo swap.  This
allows you to use memory as swap.  So in my example above if you have 1
Gig of memory you don't need any swap.  (Well you have to have some swap
but you could get away with say 256 Meg).  If your memory requirements
increased to 2 Gig and you don't add memory then you would have to grow
swap by 1 Gig.  Typically we don't have more than 2 Gig of swap in HP-UX
systems even on systems with 16 Gig this is because if you're swapping
the performance suffers so you should add memory to prevent swapping.

The best description I've heard for pseudo swap is.  

Think of a football team. 
The Players are your "Processes".
The Pitch is your "Memory" and only has room for 11 of your players.
	(Please no pedantic comments about such and such a game where there
where more than eleven players on the pitch :-)
The Bench is your "Swap" and only needs to be large enough to seat the
substitutes. 

The old way meant that the bench had to be large enough so that each
player had his own seat on the bench. 

regards,
Tom.






More information about the Sclug mailing list