[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where do you put your swap partition?



On Mon, 21 Jan 2008, Andres Migliazzo wrote:
> As far as now we have advanced in discussing where the swap partition should
> be (the location on the hard disk)... or even if is convenient to have a
> swap file or a disk partition...
> Are we in conditions to make a wrap up and a close up conclusion?

Sure.

1. It is valid to have a swap partition, if you need swap space:  they are
much easier and faster to encrypt, and safer for hibernation or crash
dumping.  The trade-off is flexibility: it is easier to resize a file.  If
you never encript, hibernate, or crash dump to swap, you might as well use
a file.

2. If the system pages enough for the swap partition's location to make a
difference, you should try for more RAM when possible.  With that in mind,
it doesn't matter much where in the disk you place it, and using files would
be just as fast.

3. The fastest area of a disk is vendor/model dependant due to sector
alocation policy across platters (and one can look for it using dd or
something else that gives you the read speed).  If you care about it,
measure your disk.

4. Place the swap area closer to the partitions of the disk which are used
the most.  Reducing head travel speed pays off a lot more than bothering
with plate write speed.

5. Excess of swap space is better than too little, since disk is cheap.
That said, you only really need as much swap as you will use in modern
Linux, you don't have to resize it because you got more RAM or anything like
that (unless you use it for hibernation).  But more swap space lets the
kernel play some performance enhancement tricks with it.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


Reply to: