Tags: howto,benchmark
Date: 20250204
So I ended up with this HP MicroServer Gen8 that I'd like to turn into a NAS or NextCloud box.
The hw specs are:My aim is to combine each SSD with each SATA (rotational) in a RAID1 and put LVM on top of everything for maximum flexibility and space usage.
Now the problem is that by default such setup will have bad performance, because the lowest common denominator here is the old and slow 5400 RPM SAMSUNG HD204UI, so reads and writes will be brought down to that speed..fio --loops=5 --size=1000m --filename=fiotest.tmp --stonewall --ioengine=libaio --direct=1 \ --name=Seqread --bs=1m --rw=read --name=Seqwrite --bs=1m --rw=write \ --name=512Kread --bs=512k --rw=randread --name=512Kwrite --bs=512k --rw=randwrite \ --name=4kQD32read --bs=4k --iodepth=32 --rw=randread \ --name=4kQD32write --bs=4k --iodepth=32 --rw=randwrite
Luckily this is Linux and I learned that the Linux RAID kernel modules can mitigate this to a degree, by means of using the option "--write-mostly" when adding a rotational drive to a RAID1 array where there is also an SSD. For clarification: Linux will not do this for you automatically, this all must be done by yourself.
root@microserver8:~# cat /sys/block/md2/md/dev-sdc2/state in_sync,write_mostly |
Seqread IOPS | Seqread BW (MiB/s) | Seqwrite IOPS | Seqwrite BW (MiB/s) | 512Kread IOPS | 512Kread BW (MiB/s) | 512Kwrite IOPS | 512Kwrite BW (MiB/s) | 4kQD32read (k) IOPS | 4kQD32read BW (MiB/s) | 4kQD32write IOPS | 4kQD32write BW (MiB/s) | |
SATA only | 125 | 126 | 51 | 52 | 76 | 38 | 67 | 33 | 0.2 | 0.9 | 184 | 0.7 |
SSD only | 418 | 419 | 178 | 178 | 649 | 325 | 292 | 146 | 88 | 345 | 9680 | 38 |
RAID+write-mostly | 482 | 482 | 50 | 50 | 766 | 383 | 65 | 33 | 85 | 166 | 0.6 | 0.7 |
RAID+write-mostly+write-behind=512 | 461 | 462 | 50 | 50 | 754 | 377 | 62 | 31 | 86 | 337 | 165 | 0.7 |
RAID+write-mostly+write-behind=2048 | 456 | 457 | 51 | 51 | 737 | 369 | 65 | 32 | 98 | 382 | 171 | 0.7 |
RAID+write-mostly+write-behind=2048+drivecache | 475 | 476 | 124 | 125 | 725 | 363 | 90 | 45 | 91 | 358 | 249 | 1 |
RAID+write-mostly+drivecache | 464 | 464 | 123 | 123 | 736 | 368 | 115 | 58 | 99 | 386 | 255 | 1 |
RAID+write-mostly+lvm-writecache | 394 | 395 | 195 | 196 | 584 | 292 | 333 | 167 | 86 | 335 | 13000 | 50 |
Conclusion:
1 - --write-mostly made a very significant difference to reads, really pleased with itSo which solution do I like best for my current use-case? I think I'll go for the RAID+write-mostly+drivecache setup. Hits a good balance of simplicity, data-safety and performance.