Article View: news.software.nntp
Article #53223Re: Setting up a server for 100k+ users
From: Andrew Gierth
Date: Wed, 11 Jul 2001 03:41
Date: Wed, 11 Jul 2001 03:41
77 lines
4265 bytes
4265 bytes
>>>>> "Curt" == Curt Welch <curt@kcwc.com> writes:
Curt> Raid 5 is very slow to write (2 reads plus 2 writes for each
Curt> block you write).
That's a gross oversimplification.
There are three basic modes of writing to a raid-5 array, depending on
the size and alignment of the write relative to the geometry of the
array.
Suppose for the sake of argument that you have a raid-5 volume of 6
disks. The layout of blocks on the array then looks something like:
Disk1 Disk2 Disk3 Disk4 Disk5 Disk6
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| 1 | | 2 | | 3 | | 4 | | 5 | | P |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| 6 | | 7 | | 8 | | 9 | | P | | 10 |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| 11 | | 12 | | 13 | | P | | 14 | | 15 |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| 16 | | 17 | | P | | 18 | | 19 | | 20 |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| 21 | | P | | 22 | | 23 | | 24 | | 25 |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| P | | 26 | | 27 | | 28 | | 29 | | 30 |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+
and so on, where the 'P's are the parity blocks.
Now, suppose you perform a write involving some of the blocks in
the first row (i.e. 1,2,3,4,5,P). These are the three cases:
read-modify-write
Suppose you're writing one or two blocks.
e.g. writing blocks 1 and 2 is done by:
- reading the current values of blocks 1,2 and P
- XOR together the old values of blocks 1 and 2, their new
values, and the current content of P; this gives the new
content of P
- write the new values of 1,2 and P
So the total cost to write 1 or 2 blocks is 2 or 3 reads, a parity
computation, and 2 or 3 writes
recover-write
If you're writing half or more of the data blocks in a stripe at
once, then the above method is inefficient.
Instead, writing blocks 1,2,3 would be performed as follows:
- read the current value of blocks 4 and 5
- compute the new parity block from the new values of 1,2,3 and
the old values of 4 and 5
- write the new values of 1,2,3 and P
So here the total cost is one read per _untouched_ block, plus
one write per modified block and the parity block.
full-stripe write
If you're writing all the data blocks in a stripe at once (i.e.
writing blocks 1,2,3,4,5 all in one go), then this can be done at
maximum efficiency with no reads at all:
- compute the new parity block from the new data blocks
- write the new data and parity blocks
So here the only extra cost is the computation and writing of the
parity block.
Now, which of these actually ends up happening will depend on a number
of factors: especially the block size and number of columns in the
array, the organization of the filesystem, the degree of write-behind
performed by the system, the effectiveness of any I/O optimizations,
etc.
--
Andrew.
Technical Details
Message-ID:
<87hewk5dz1.fsf@erlenstar.demon.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!news-feed.riddles.org.uk!erlenstar.demon.co.uk!newsmonsterReferences:
<9ifl4a01i1l@enews3.newsguy.com> <20010710203827.705$Bi@newsreader.com>Show Full Headers
Complete Article Headers
Message-ID: <87hewk5dz1.fsf@erlenstar.demon.co.uk> Subject: Re: Setting up a server for 100k+ users Date: Wed, 11 Jul 2001 03:41:54 +0000 From: Andrew Gierth <andrew@erlenstar.demon.co.uk> References: <9ifl4a01i1l@enews3.newsguy.com> <20010710203827.705$Bi@newsreader.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!news-feed.riddles.org.uk!erlenstar.demon.co.uk!newsmonster Newsgroups: news.software.nntp Organization: disorganised Lines: 76 NNTP-Posting-Host: erlenstar.demon.co.uk (00ca:09d2) X-Mayan-Date: Long count = 12.19.8.6.17; tzolkin = 7 Caban; haab = 15 Tzec X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29 X-Attribution: AG X-P-Persistent-Headers: are a bad idea. X-Newsreader: Gnus v5.5/Emacs 20.2 X-Complaints-To: andrew@erlenstar.demon.co.uk X-Post-Filter: postfilter v0.6 alpha