# Know about chunk size

- List: linux-raid
- 6 messages, 4 authors
- Page: https://ratatoskr.run/linux-raid/2012/11/6622421/t

## Know about chunk size

- From: Kks Kbase \<hidden\>
- Date: 2012-11-25 03:15:34 
- Message: https://ratatoskr.run/linux-raid/2012/11/6622421.md

```text
Hi Folks,

I want to know what is best chunk size to create s/w raid devices? Also is it possible to change the chunk size for an existing array?
```

## Re: Know about chunk size

- From: Roy Sigurd Karlsbakk \<hidden\>
- Date: 2012-11-26 07:35:09 
- Message: https://ratatoskr.run/linux-raid/2012/11/6622435.md

```text
> I want to know what is best chunk size to create s/w raid devices?

That depends on the workload, file sizes etc. The default will probably do fine

> Also is it possible to change the chunk size for an existing array?

AFAIK, no

Vennlige hilsener / Best regards

roy
--
Roy Sigurd Karlsbakk
(+47) 98013356
roy@karlsbakk.net
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
I all pedagogikk er det essensielt at pensum presenteres intelligibelt. Det er et elementært imperativ for alle pedagoger å unngå eksessiv anvendelse av idiomer med xenotyp etymologi. I de fleste tilfeller eksisterer adekvate og relevante synonymer på norsk.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```

## Re: Know about chunk size

- From: Stan Hoeppner \<hidden\>
- Date: 2012-11-26 22:11:34 
- Message: https://ratatoskr.run/linux-raid/2012/11/6622439.md

```text
On 11/26/2012 1:35 AM, Roy Sigurd Karlsbakk wrote:
>> I want to know what is best chunk size to create s/w raid devices?
> 
> That depends on the workload, file sizes etc. 

Correct.  And greatly depends on array type.

> The default will probably do fine

This is not true of metadata 1.2 and parity arrays in which case the
default chunk size is 512KB.  That's way too large for anything but
large file streaming workloads.  Most workloads involve metadata and
small files.  This has been discussed previously in detail on this list
and on the XFS list.  For most workloads other than large file
streaming, mirroring+striping is best, but if you must use parity RAID a
small chunk size of 32/64KB yields superior IO performance due to
decreased overhead during RMW.

>> Also is it possible to change the chunk size for an existing array?

No.  You must destroy and recreate it with the new chunk size.  If one
creates an array with an appropriate chunk size there is no need to ever
change it, UNLESS the primary workload hitting the array changes from
random IO to large streaming, or the reverse.  In such a case one
typically builds a new server with a new array, or simply adds a new
array to the existing server for the new workload.  If you are
redeploying the server/array, destroy and recreate with the new optimal
chunk size.

-- 
Stan

```

## Re: Know about chunk size

- From: Kks Kbase \<hidden\>
- Date: 2012-11-27 07:39:17 
- Message: https://ratatoskr.run/linux-raid/2012/11/6622448.md

```text
Okay thanks.

If we deleted the raid device and created new one with the disks that have data would it cause the data loss?



----- Original Message -----
From: Stan Hoeppner <redacted>
To: Roy Sigurd Karlsbakk <redacted>
Cc: Kks Kbase <redacted>; Linux Raid <redacted>
Sent: Tuesday, 27 November 2012 3:41 AM
Subject: Re: Know about chunk size

On 11/26/2012 1:35 AM, Roy Sigurd Karlsbakk wrote:
>> I want to know what is best chunk size to create s/w raid devices?
> 
> That depends on the workload, file sizes etc. 

Correct.  And greatly depends on array type.

> The default will probably do fine

This is not true of metadata 1.2 and parity arrays in which case the
default chunk size is 512KB.  That's way too large for anything but
large file streaming workloads.  Most workloads involve metadata and
small files.  This has been discussed previously in detail on this list
and on the XFS list.  For most workloads other than large file
streaming, mirroring+striping is best, but if you must use parity RAID a
small chunk size of 32/64KB yields superior IO performance due to
decreased overhead during RMW.

>> Also is it possible to change the chunk size for an existing array?

No.  You must destroy and recreate it with the new chunk size.  If one
creates an array with an appropriate chunk size there is no need to ever
change it, UNLESS the primary workload hitting the array changes from
random IO to large streaming, or the reverse.  In such a case one
typically builds a new server with a new array, or simply adds a new
array to the existing server for the new workload.  If you are
redeploying the server/array, destroy and recreate with the new optimal
chunk size.

-- 
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```

## Re: Know about chunk size

- From: Roy Sigurd Karlsbakk \<hidden\>
- Date: 2012-11-27 08:19:00 
- Message: https://ratatoskr.run/linux-raid/2012/11/6622449.md

```text
----- Opprinnelig melding -----
> Okay thanks.
> 
> If we deleted the raid device and created new one with the disks that
> have data would it cause the data loss?

It will cause 100% data loss on the old RAID. The new one will come up empty and shiny.

Vennlige hilsener / Best regards

roy
--
Roy Sigurd Karlsbakk
(+47) 98013356
roy@karlsbakk.net
http://blogg.karlsbakk.net/
GPG Public key: http://karlsbakk.net/roysigurdkarlsbakk.pubkey.txt
--
I all pedagogikk er det essensielt at pensum presenteres intelligibelt. Det er et elementært imperativ for alle pedagoger å unngå eksessiv anvendelse av idiomer med xenotyp etymologi. I de fleste tilfeller eksisterer adekvate og relevante synonymer på norsk.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```

## Re: Know about chunk size

- From: Piergiorgio Sartor \<hidden\>
- Date: 2012-11-27 18:36:40 
- Message: https://ratatoskr.run/linux-raid/2012/11/6622464.md

```text
On Tue, Nov 27, 2012 at 03:39:17PM +0800, Kks Kbase wrote:
[...]
> >> Also is it possible to change the chunk size for an existing array?
> 
> No.  You must destroy and recreate it with the new chunk size.  If one

It seems to me it is possible.

Should be one option of "Grow", as far as I can remember.

The issue is, it is not possible to increase the size,
unless it will fit the current number of chunks.

So, for example, if the size is doubled, there should
be an even number of chunks.

Furthermore, LVM will not be happy if the alignment is
lost due to this. It will complain, but it will work.

bye,

-- 

piergiorgio
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
