On 05/03/2021 09:25, Anssi Saari wrote: > Greg Wooledge <g...@wooledge.org> writes: > >> to...@tuxteam.de (to...@tuxteam.de) wrote: >>>> 1x 4TB, single drive, 3.7 TB, w=108MB/s , rw=50MB/s , r=204MB/s >>>> 2x 4TB, mirror (raid1), 3.7 TB, w=106MB/s , rw=50MB/s , r=488MB/s >>> Thanks. Real data :) >>> >>> The doubling in read throughput is somewhat surprising to me. Some >>> learning to do, it seems. >> There are two copies of everything. So, if you need to read a big >> file, you can read half of it from disk 1 and the other half from disk 2, >> roughly simultaneously. > I have a vague memory of reading once that mdraid doesn't stripe reads > to a single file. I.e. with raid1 you get the double speed if you read > different files (or different parts of disk) but reading a single file, > no. RAID won't know what's a file or not. It works below the file system layer, so only concerns itself with blocks. For any particular block, a RAID1 array has N copies of that block to read from. It makes no sense to read all of those copies - imagine if you were really paranoid and had a 10-disk RAID array. Instead, the driver will choose one of the constituent drives and read the block from that drive. So, if your file is small, then yes, you won't see any performance benefit. But if your file is larger than a block, or if you want to access more than one file at once, then RAID can read the second block from a different drive. Remember thatĀ the I in RAID stands for Inexpensive. RAID assumes that the disk is slow, the bus is faster and the applications are impatientĀ :) > > So is this different in zfs? I guess I could test this myself. The way > Bonnie++ was used for those results above is definitely parallel. ZFS will work in much the same manner, except when performing a "scrub". During a scrub, all copies of all blocks are read and compared. If a block differs across the mirrors, then ZFS has a decision to make: if there are more identical copies than different copies, ZFS assumes that the identical copies are good (hence why having a three-way mirror is recommended). Alternatively, ZFS uses checksums on stored data. If the block doesn't match the checksum, then ZFS can also recover that data. More details here https://blogs.oracle.com/bonwick/zfs-end-to-end-data-integrity >
OpenPGP_signature
Description: OpenPGP digital signature