How does the mdadm Chunk parameter translate to SNIA definitions?

0

The manpage for mdadm describes a -c, --chunk= parameter, quoted below, that seems to relate to the RAID 0 stripe size. However, the SNIA definition of the parameters for RAID 0 is not a single value, but is made of three values: Block Size, Strip Depth, and Extend Stripe Length. I'm curious how this chunk parameter translates into the SNIA defined terms. The big hangup I'm having is "Strip_ Depth" vs. "Stripe Length".

If I run mdadm ... -c 32K on a RAID 0 array of 8 disks with a 4K sector size, is it going to create an array with a "Strip_ Depth" of 32K (8 sectors) and a "Stripe Size" that is 8 of those? Or is it going to create an array with a "Strip_ Depth" of 4K (1 sector) and a "Stripe Length" of 8, which together make a "Stripe Size" of 32K?

manpage snippet:

      -c, --chunk=
              Specify  chunk  size of kibibytes.  The default when creating an array is 512KB.  To ensure compatibility with earlier versions,
              the default when Building and array with no persistent metadata is 64KB.  This is  only  meaningful  for  RAID0,  RAID4,  RAID5,
              RAID6, and RAID10.

              RAID4, RAID5, RAID6, and RAID10 require the chunk size to be a power of 2.  In any case it must be a multiple of 4KB.

              A suffix of ’M’ or ’G’ can be given to indicate Megabytes or Gigabytes respectively.

From SNIA Command RAID Disk Data Format Specification, Version 2, Section 4.2.1 RAID-0 Simple Striping:

SNIA RAID-0 Simple Striping

Huckle

Posted 2017-06-27T00:41:34.083

Reputation: 376

Answers

0

From: https://raid.wiki.kernel.org/index.php/RAID_setup#Chunk_sizes it appears that the Chunk size is equal to the "Strip_ Depth", rather than the "Stripe Size".

RAID-0

Data is written "almost" in parallel to the disks in the array. Actually, chunk-size bytes are written to each disk, serially. If you specify a 4 kB chunk size, and write 16 kB to an array of three disks, the RAID system will write 4 kB to disks 0, 1 and 2, in parallel, then the remaining 4 kB to disk 0. A 32 kB chunk-size is a reasonable starting point for most arrays. But the optimal value depends very much on the number of drives involved, the content of the file system you put on it, and many other factors. Experiment with it, to get the best performance.

Huckle

Posted 2017-06-27T00:41:34.083

Reputation: 376