Subject: Re: 3ware RAID controller slow?
To: None <netbsd-users@NetBSD.org>
From: Bill Stouder-Studenmund <wrstuden@netbsd.org>
List: netbsd-users
Date: 10/30/2007 08:45:43
--7CZp05NP8/gJM8Cl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Oct 28, 2007 at 06:16:37PM -0400, Douglas A. Tutty wrote:
> On Mon, Oct 29, 2007 at 12:04:47AM +0200, Jukka Marin wrote:
> >=20
> > Then why is RAID5 slow and a plain disk isn't (when extracting the same
> > pkgsrc tarball)?  I'm trying to find out whether I can use RAID5 or not,
> > that's why I'm asking ;)
>=20
> Some thoughts:
>=20
> RAID5 means computing parity.  On a hardware RAID card, the hardware is
> supposed to do it; on software RAID, the software does it.  Either way,
> parity must be computed and written to multiple disks.  Since you're
> extracting a tarball:
>=20
> plain disk:
>=20
> 	grab a block from the tarball
> 	unpack the block
> 	write the block to the filesystem
> 		write block to disk
>=20
> raid5:
> 	grab a block from the tarball
> 		pull correct data and parity blocks from disks
> 		calculate parity ensure correct

Most RAID 5 implementations I'm familiar with don't do this step. They
just read the requested block. The assumption is that if the disk does not
report an error, then it correctly read the blocks.

My understanding is that the twa card is in this category.

> 	unpack the block
> 	write the block to the filesystem
> 		calculate the parity of the block
> 			write data and parity blocks to disks.

And so if you're writing less than a stripe, you trigger the reads here.

> plain disk does one read and one write for each block
> 	(assuming that swap isn't being hit)
>=20
> raid5 does two reads and two writes for each block
> 	plus two parity calcs.

I only saw one write. Yes, we write parity and the new data, but they go=20
to different disks and they're done in parallel. So it really only counts=
=20
as one.

> 	If its hardware, the disk writes and reads should be in parallel
> 	Is the parity calc done fast enough to keep the drives served or
> 	does it become a bottleneck?  If its software raid, does it eat
> 	into the tarball unpack time?
>=20
> I've seen on the Debian-user list some references to a document on the
> net about why not to use raid5 but rather raid 1 or 10.  Performance is
> the big issue.

RAID-10 is faster if you can afford the disks. Also, your double-fault=20
window is smaller. Assuming you do the RAID-10 right...

RAID-10 also has the advantage that you don't need to ever read to write.

Take care,

Bill

--7CZp05NP8/gJM8Cl
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)

iD8DBQFHJ1GmWz+3JHUci9cRAjOnAJ9dwS+sdOpmp1ZOBCChJyclDklQ0QCdHGFW
LSnFpGEFW9hF/1LM9Ok4tZ0=
=LXWA
-----END PGP SIGNATURE-----

--7CZp05NP8/gJM8Cl--