24 November, 2013

Stripped LVM (RAID 0) performance on a NAS system

Now I am setting up a new NAS and to be able to decide if I should use Stripped LVM I did some measurements. Stripped LVM means the the data volume is spread across 2 physical disks and data reads and writes are executed in parallel to the two disks, so in theory this will duplicate the disks speed. However stripping has one disadvantage that if one of the disks fails then all data is lost, while with normal volumes, there are chances that from the functional disk it is possible to restore the data. The NAS has a Gigabit Ethernet LAN connection so in theory 125 MBytes/sec speeds can be achieved.

To do the tests I have set up two 200 GByte logical volumes on the LVM containing two 4 Tbytes physical disks, one stripped across the two disks and the other without stripping. First I measured the speed within the NAS, using the linux DD command:

On the normal volume:

>dd if=/dev/zero of=/media/data/Adatok/test bs=1M count=2000      2000+0 records in
2000+0 records out
2097152000 bytes (2.1 GB) copied, 13.979 s, 150 MB/s

and on the stripped:

>dd if=/dev/zero of=/media/data/Adatok/test bs=1M count=2000
2000+0 records in
2000+0 records out
2097152000 bytes (2.1 GB) copied, 7.52203 s, 279 MB/s

This looks promising, the stripped disk looks almost 2 times faster (and the overall speed is also pretty impressing).

In the next step I have set up a Samba share and used CrystalMark to measure the speeds on the Windows 7 client machine:


What can be seen, that with 100MB size the results are almost identical and with 1000 MB size the results are also very similar, with some differences with small block sizes. Probably these differences are some kind of measurement error.

So the conclusion is clear, it is not worth to use Raid 0 or LVM stripping in a NAS, because it just reduces the security and doesn't improve the speed.

For comparison I include 3 other measurements done on the same Windows machine with internal/USB disks:


 This may also indicate some explanation for the poor 4K performance; this may be normal for HDDs and with the NAS with small file sizes the cache may help to improve it an almost SSD level.

No comments: