I tried to find a more applicable community to post this to but didn’t find anything.

I recently set up a NAS/server on a Raspberry Pi 5 running Raspberry Pi OS (see my last post) and since then I’ve got everything installed into a 3D printed enclosure and I’ve got RAID set up (ZFS RAIDz1). Prior to setting up RAID, I could transfer files to/from the NAS at around 200MB/s, but now that RAID is seemingly working things are transferring at around 28-30 MB/s. I did a couple searches and found someone suggesting to disable sync ($ sudo zfs set sync=disabled zfspool). I tried that and it doesn’t seem to have had any effect. Any suggestions are welcome but keep in mind that I barely know what I’m doing.

Edit: When I look at the SATA hat, the LEDs indicate that the drives are being written to for less than half a second and then there’s a break of about 4 seconds where there’s no writing going on.

  • HiTekRedNek@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    5 days ago

    When people talk about CPU limitations on the rPi, they aren’t talking about just the actual processing portion of the machine. There are also a lot of other corners cut for basically all SBCs. Including bus width and throughput.

    The problem is that when you use a software raid, like ZFS, or it’s precursors, you are using far more than the CPU. You’re also using the data bus between the CPU and the IO controller.

    “CPU usage” indicators don’t really tell you how active your data buses are, but how active your CPU is, in having to process information.

    Basically, it’s the difference between IO wait states, and CPU usage.

    The Pi is absolutely a poor choice for input/output, period. Regardless of your “metrics” tell you, it’s data bus simply does not have the bandwidth necessary to control several hard drives at once with any sort of real world usability.

    You’ve wasted your money on an entire ecosystem by trying to make it do something it wasn’t designed, nor has the capability, to do.

  • calamityjanitor@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    5 days ago

    sync=disabled will make ZFS write to disk every 5 seconds instead of when software demands it, which maybe explains your LED behavior.

    Jeff Geerling found that writes with Z1 was 74 MB/sec using the Radxa Penta SATA HAT with SSDs. Any HDD should be that fast, the SATA hat is likely the bottleneck.

    Are you performing writes locally, or over smb?

    Can try iostat or zpool iostat to monitor drive writes and latencies, might give a clue.

    How much RAM does the Pi 5 have?

    • calamityjanitor@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      5 days ago

      After some googling:

      Some Linux distributions (at least Debian, Ubuntu) enable init_on_alloc option as security precaution by default. This option can help to prevent possible information leaks and make control-flow bugs that depend on uninitialized values more deterministic.

      Unfortunately, it can lower ARC throughput considerably (see bug).

      If you’re ready to cope with these security risks 6, you may disable it by setting init_on_alloc=0 in the GRUB kernel boot parameters.

      I think it’s set to 1 on Raspberry Pi OS, you set it in /boot/cmdline.txtI think.

      Exhaustive ZFS performance tuning guide

    • ramenshaman@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      5 days ago

      I haven’t seen more than maybe 32MB/s. The transfers I’ve done are all on my local network from my desktop to my NAS which is plugged into my router. I have samba installed, my NAS shows up as a network drive just fine and I’ve just been dragging/dropping on my desktop GUI. Before setting up RAID, when I did this I would get around 200MB/s. The Pi has 16GB of RAM and I’m using less than 1.5GB while making a large transfer from my desktop to the NAS.

      • Lemmchen@feddit.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        5 days ago

        Those 200MB/s probably weren’t synchronous transfers. The OS tells you the write was complete, but it actually hasn’t committed the data to disk yet. (Wild guess)

      • calamityjanitor@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        5 days ago

        Ah kay, definitely not a RAM size problem then.

        iostat -x 5 Will print out per drive stats every 5 seconds. The first output is an average since boot. Check all of the drives have similar values while performing a write. Might be one drive is having problems and slows everything down, hopefully unlikely if they are brand new drives.

        zpool iostat -w Will print out a latency histogram. Check if any have a lot above 1s and if it’s in the disk or sync queues. Here’s mine with 4 HDDs in z1 working fairly happily for comparison:

        Here's mine with 4 HDDs  in z1 working fairly happily for comparison

        The init_on_alloc=0 kernel flag I mentioned below might still be worth trying.

  • Zanathos@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    5 days ago

    What type of disk (HDD or SSD) and how many disks in the pool?

    RAIDZ1 configuration will bring your write speed down some due to data having to write to multiple disks at a time. This is true for most any RAID. Once written, your read speeds should remain the same or improve a bit though.

  • monkeyman512@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    4 days ago

    Other people have already talked about why you are having performance issues with the Pi. As for a better NAS solution you will probably be better off with a used desktop PC from the last 10 years. If the computer doesn’t have enough SATA ports you can get a sata addon card or HBA (host buss adapter) addon card flashed in IT mode. You should be able to find a lot of options on eBay. Maybe people can chime in with specific models to look at.

  • TCB13@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    2
    ·
    5 days ago

    It’s a Pi, what are you expecting. You just wasted a ton of money on inferior hardware with extra software issues. You could’ve just got a mini pc with 2 nvme slots instead for half the price and add a 6 port sata board for 20$ to one of those. Much cheaper, way more reliable, upgradable and ZFS actually would’ve work as you expect.

    • ramenshaman@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      5 days ago

      Just getting my feet wet. I have plenty of other uses for a Pi so if the NAS doesn’t work out that’s fine, I’ll get something else. Worst case I’m out $70-ish for the Raxda SATA hat. Something is seemingly not right with my config, I haven’t gotten the Pi to break a sweat yet. Thanks for your input though.

  • Creat@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    5 days ago

    What size is the ARC set to? I’ve seen cases where it was fully disabled, which (unsurprisingly) seemed to murder performance and is probably even worse when in such a CPU limited platform. You stating that only 1.5 GB of 16 GB were in use makes this seem likely.

    In general, if you care even remotely about performance, a raspberry pi is probably the wrong choice for a NAS. Even a single disk should have no issues saturating a 1gbe link. That being said, even a pi should manage 1 GBit/s on ZFS, especially when reading.

    • ramenshaman@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      5 days ago

      I don’t know what ARC is and my searches so far haven’t helped. The CPU usage is pretty low, on htop is rarely passes 10%.

      Edit: I asked chatGPT what it means, this seems like exactly the setting I was hoping to find. I’ll check it out and post an update.

      Edit2: I changed the ARC size to 8GB and it definitely seems to have gotten slower.

      • Lemmchen@feddit.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        5 days ago

        Do you have the 8GB version of the Pi 5? You shouldn’t set the ARC to 8GB then. Usually it about half of the available system RAM. I’d probably set it lower if there’s only 8GB available in total.

      • Creat@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        5 days ago

        ARC is the in-memory cache used by ZFS. If it’s completely off the effect can be dramatic. Under no circumstances should a larger cache cause anything to get slower, ever. Even the raspi didn’t have memory that is that slow that this is a reasonable outcome. By default on most distros, ARC size is capped to 50% of physical system memory. Keep in mind it is a cache: if something else needs needs the RAM, it will be released.

        As a concrete example: I was recently working on a server where a maintenance task that should take like 12hrs or so at the worst somehow took 2 weeks (!) and still wasn’t finished. That was ARC being disabled.