| Author |
Message |
Erez
Guest
|
Posted:
Sun Nov 13, 2005 5:05 pm Post subject:
Read commands in RAID-5 |
|
|
Hi,
I'm trying to understand the behavior of a RAID-5 controller when
executing long READ commands:
For READ commands with long data length, the controller may have to
read several blocks from each disk. Since all disks contain parity
blocks, the controller will need to skip them when reading from a disk.
For example:
D0-D3 are disks 0-3.
P0-P2 are the parity blocks.
00-08 are the requested data blocks.
D0 D1 D2 D3
00 01 02 P0
03 04 P1 05
06 P2 07 08
Now, the controller has to read blocks 02 & 07 from disk 2. Will it use
a single READ command and throw away the parity block (P1) or will it
use 2 READ commands? Is there another option?
Thanks
Erez |
|
| Back to top |
|
 |
Erez
Guest
|
Posted:
Sun Nov 13, 2005 5:15 pm Post subject:
Re: Read commands in RAID-5 |
|
|
I'm trying to check if the following optimization makes sense:
When the controller wants to read blocks 02 & 07 (without P1), it will
use SCSI PRE-FETCH command to ask the disk to read 02, P1 & 07 to its
cache and then, the controller will send 2 READ commands (for 02 & for
07). By doing that, only a single disk operation is required and
unnecessary data isn't written to the data-in buffer.
Again, here's the example that I'm talking about:
D0-D3 are disks 0-3.
P0-P2 are the parity blocks.
00-08 are the requested data blocks.
D0 D1 D2 D3
00 01 02 P0
03 04 P1 05
06 P2 07 08
Do you have any idea if vendors use something like that? I don't know
if it makes sense in terms of latency and throughput.
Thanks
Erez |
|
| Back to top |
|
 |
Erez
Guest
|
Posted:
Sun Nov 13, 2005 5:15 pm Post subject:
Re: Read commands in RAID-5 |
|
|
Thanks, Rob.
I didn't think about this optimization. BTW - why will it read P1? If
the controller doesn't intend to really read block 07, it can read only
block 02. The only explaination that I see is that it may use P1 in
order to calculate values of other data blocks in the same parity group
(stripe).
Are there other optimizations for this problem?
Erez |
|
| Back to top |
|
 |
Rob Turk
Guest
|
Posted:
Sun Nov 13, 2005 5:15 pm Post subject:
Re: Read commands in RAID-5 |
|
|
"Erez" <erezz@tx.technion.ac.il> wrote in message
news:1131879927.362591.24130@g47g2000cwa.googlegroups.com...
| Quote: | Hi,
I'm trying to understand the behavior of a RAID-5 controller when
executing long READ commands:
For READ commands with long data length, the controller may have to
read several blocks from each disk. Since all disks contain parity
blocks, the controller will need to skip them when reading from a disk.
For example:
D0-D3 are disks 0-3.
P0-P2 are the parity blocks.
00-08 are the requested data blocks.
D0 D1 D2 D3
00 01 02 P0
03 04 P1 05
06 P2 07 08
Now, the controller has to read blocks 02 & 07 from disk 2. Will it use
a single READ command and throw away the parity block (P1) or will it
use 2 READ commands? Is there another option?
Thanks
Erez
|
There's controllers that will figure out the shortest mix of data and parity
blocks it needs to reconstruct all data and read accordingly. So in your
example it may choose to only read blocks 02 and P1, and recalculate block
07 on the fly from blocks it read from the other drives.. Depends if the
hardware on the controller can reconstruct faster than it takes to read a
single block..
Rob |
|
| Back to top |
|
 |
Rob Turk
Guest
|
Posted:
Mon Nov 14, 2005 12:10 am Post subject:
Re: Read commands in RAID-5 |
|
|
"Erez" <erezz@tx.technion.ac.il> wrote in message
news:1131888133.316976.246140@g14g2000cwa.googlegroups.com...
| Quote: | I'm trying to check if the following optimization makes sense:
When the controller wants to read blocks 02 & 07 (without P1), it will
use SCSI PRE-FETCH command to ask the disk to read 02, P1 & 07 to its
cache and then, the controller will send 2 READ commands (for 02 & for
07). By doing that, only a single disk operation is required and
unnecessary data isn't written to the data-in buffer.
Again, here's the example that I'm talking about:
D0-D3 are disks 0-3.
P0-P2 are the parity blocks.
00-08 are the requested data blocks.
D0 D1 D2 D3
00 01 02 P0
03 04 P1 05
06 P2 07 08
Do you have any idea if vendors use something like that? I don't know
if it makes sense in terms of latency and throughput.
Thanks
Erez
|
I think you should take a look at the overhead involved with sending a
command, versus transferring an extra block of data. You may find that the
data transfer of an extra block takes nowhere near as much time as sending
extra commands. I don't have the specs in front of me, but I'm sure you can
do the math yourself to find if it makes sense.
Rob |
|
| Back to top |
|
 |
Guest
|
Posted:
Tue Nov 15, 2005 5:16 pm Post subject:
Re: Read commands in RAID-5 |
|
|
That's what I thought. Thanks a lot for your help.
Erez |
|
| Back to top |
|
 |
|
|
|
|