[Gllug] To partition or not to partition

Alain Williams addw at phcomp.co.uk
Wed Oct 13 10:17:24 UTC 2010


On Wed, Oct 13, 2010 at 10:58:20AM +0100, John Edwards wrote:

> Are there any performance hits for swap on LVM on RAID?
> 
> I've a few servers that run Java programs that allocate large chunks
> of RAM (100s MB) that do not get used often and so tend to stay mostly
> in swap while the real RAM is used for more important things.
> 
> In the past I've tended to allocate old fashioned swap partitions
> (one on each disk) to handle this. With LVM on RAID1 I would end up
> using twice the space needed because of the mirroring, as well as
> extra disk writes.

The way that I look at it is:

* Disk is cheap - the cost of allocating bucket loads of disk for swap is cheap.
* With RAID 1 - the cost of twice cheap is still cheap.
* The cost of downtime due to a disk failing is going to be higher than cheap.

* If stuff gets swapped out and stays there. The cost of getting it there is cheap.
* If stuff swaps in & out a lot: what is (for you) the cost in terms of lost performance
  against the cost of more RAM ?

* Writing to RAID1 swap means 2 writes, but they can happen in parallel.
  I guess (no data on this) that a RAID1 write is not much slower than a plain write.
* The time spent in RAID1 & LVM code in the kernel is dwarved by the time getting the disk to do something.

* Reading from RAID1 - you have 2 disks and so can read at twice the speed.


-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Past chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list