Posts: 2
Joined: Sun Jul 18, 2021 1:24 am

PI 4 - NAS + SSD Cache

Sun Jul 18, 2021 1:44 am

The following is my system which I am using as NAS

PI 4 ~ 4GB
OS ~ RaspiOS
2 x IronWolf NAS 4TB (Raid 1)
1 x 128 GB SSD

My question is.. How do I set up my 128GB SSD to be use as cache to speed up the reading/writing access?

Thank you in advantage.

Posts: 267
Joined: Wed Jan 27, 2021 12:48 pm

Re: PI 4 - NAS + SSD Cache

Mon Jul 19, 2021 9:23 pm

You could look at https://bcache.evilpiepirate.org/ or https://github.com/stec-inc/EnhanceIO

Many things to consider:
1) Are you comfortable messing around at this level of config?
2) Is your hardware reliable?
3) Does your SSD support TRIM?
4) Do you have backups of the data (RAID is not a backup)?
5) Do you have suitable power protection - both at cache and system level?
6) If / when it goes wrong can you understand the recovery process or can you restore from backups?
7) Are the disks the actual bottleneck?
Is a computer language with goto's totally Wirth-less?

User avatar
Posts: 5558
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: PI 4 - NAS + SSD Cache

Tue Jul 20, 2021 12:44 am

Unless you're doing a lot of small file random access to/from the RAID array it probably isn't worth it.

Are those NAS drive in a single enclosure with one upstream connection or in two enclosures each with their own?
Is that SSD connected via USB 2 or USB 3?

Everything is limited by the single PCIe lane between the SoC and the USB controller. Theoretically sustaind transfers from one SATA III device will max that out.

And once the network comes into it, transfer speeds get further bottle necked and you likely won't see any performance advantage at all.

About the only advantage you'll see is that for data already in the cache on the SSD random access will be slightly faster as it doesn't haev to wait for the disc heads to be in the correct position before it can send it. If the data you want isn't in the cache you'll get a reduction in perofrmance the first time you try to read it as the OS checks the cache then goes out to the disc.

You also have the issue of keeping cache and RAID array in sync.

TL;DR: not worth the effort involved. Network clients won't see any difference.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

Posts: 2
Joined: Sun Jul 18, 2021 1:24 am

[closed]Re: PI 4 - NAS + SSD Cache

Sat Jul 24, 2021 11:26 pm

In the end, I decided not to use the SSD as cache because it was not worth the effort. In addition to this, right now the bottleneck is my current Internet Connection Speed so... What I did though, I set up a RAID 1 with 3 HDDs just to be on the safe side. Time will tell if I made the right call.

Mr. Thagrol, to answer your question, I am using the below configuration for me 3 HDDs

Code: Select all

External Hard Drive Docking Station  ~ 2x4TB IronWolf NAS

External Hard Drive Docking Station  ~ 1x4TB IronWolf NAS

Thank you Mr. MiscBits and Mr. Thagrol for your help and guidance.

Return to “Networking and servers”