On X870, a ZFS pool of 3x M.2 drives, each PCIe 5.0x4- doable?

Main AM5 series CPU’s have 28 PCIe lanes. As I understand none of these are used for integrated graphics, so you don’t lose any of them if you only use the integrated graphics.

Four of these slots are reserved for the chipset and not available to you.

That leaves 24x lanes directly to the CPU you can use.

In typical configurations 16 of those are used for the main GPU slot, (though this can be dropped down to 8x, if a second 16x slot is used, in which case it gets the other 8)

Then there are 8x left. 4x are usually used for the primary m.2 slot, and 4x are usually used for the 40Gbit USB feature AMD now requires on higher end boards.

Some boards allow you to disable the 40Gbps USB - however - and instead use those 4 CPU lanes for a second m.2 slot

If you get the right x870 board, the right CPU and you don’t care about a GPU (or only want to use the integrated GPU) you should be able to use up to 6 4x NVMe drives direct to the CPU.

Drive 1 - Dedicated M.2 CPU slot on board
Drive 2 - Secondary optional M.2 slot on board gained by disabling 40Gbps USB)
Drive 4-6 - 4-way riser in 16x Slot that fits four 4x drives

(alternatively, if you get a better deal on them you could use two 8x two way risers, one in each slot, instead of one 16x riser.

All of these will run on CPU lanes, and be Gen5 capable, but there are some caveats.

1.) To use the 40Gbps USB 4x lanes for m.2 instead, your motherboard must support this capability. Only a minority of motherboards do.

2.) Your motherboard must either support PCIe Bifurcation on the 16x slot(s) (often called NVMe RAID mode in PCIe settings). This splits the 16x slot up into four 4x slots for use with an adapter. If your motherboard does not support bifurcation, you need to use an adapter that has a PCIe switch (often referred to as a PLX switch) in it. These are more expensive, use more power, and add latency, making the storage slower. Generally they are not considered a good idea other than as a last resort.

3.) In order to get Gen5 performance out of the slot riser, you must buy one that claims to get Gen5 speeds. The higher the gen, the trickier it is to maintain the speeds with longer signal paths, so unless it specifically tells you it has Gen5 speeds, chances are an adapter suffers too much signal degradation and it doesn’t work. Sometimes these can be made to work at slower speeds by manually setting the port to Gen4 or lower in the bios, but sometimes they just outright refuse to work.

I have never cross-shopped for exactly these features in an AM5 board, so I don’t know exactly which support both disabling 40gig USB and using the lanes for an m.2 and bifurcation on the 16x slot.

@lemma put together this nice list of boards that support a second m.2 slot to the CPU the last thread I discussed this topic in, here.

I’m sure at least a few of those support bifurcation, but you’ll need to do your research and confirm it or it won’t work.

As for risers, I have five Asus Hyper 4-way 16x to 4x m.2 risers in various systems. (Three in my server, one in my main workstation and one in my backup workstation). They have worked perfectly for me in both server and workstation use, with ZFS in all cases, so I do recommend them. Mine are the Gen4 versions though. Since you want Gen5 speeds, you are going to want the Gen5 versions.

I cannot speak to how well the Gen5 risers work, but if they perform as well as the Gen4 ones do, they should be great.

Once again, these risers DO require that your motherboard supports bifurcation, and has it enabled, otherwise you will only see the first drive. Sometimes in the bios this is called PCIe raid mode (or something like that) so you may need to poke around in order to find the right setting. It isn’t always apparent. And not all motherboards support it.

This is going to depend very much on your use case. Can you share any more details?

You say you want to maximize read and write performance. Are you more interested in Sequential reads/writes for quickly copying large files back and forth, or more interested in IOPS/Latency/4k random performance that make many databases and applications more responsive?

The general wisdom is that if you are gunning for performance in ZFS nothing beats a mirror. And you can just add more of them and ZFS will stripe the mirrors together and (in theory) benefit from them performance wise.

IN my experience this wisdom checks out perfectly with hard drives (SATA or SAS) and SATA SSD’s, but with NVMe - in my experience - something else becomes the bottleneck in a hurry. While I absolutely love ZFS, I haven’t found the performance to be terribly impressive on late gen NVMe drives in any configuration where they are used for main pool data storage.

(using them for “Special” devices is something different all together and can help a lot. though. And if you need sync writes, nothing beats using Optanes, which are also NVMe drives.)

I mean, sure, way faster than any SATA SSD. but it just doesn’t scale as well as you add faster and faster NVMe drives, with each gen giving you less and less.

For instance, on my main workstation, I have a storage pool consisting of four 1TB Samsung 990 drives, configured as two mirrors (so, ZFS equivalent of RAID10)

I also added tow mirrored 280GB Optane 900P’s as SLOG/LOG/ZIL drives in order to speed up sync writes.

So this is all Gen4, not Gen5.

The intent of this storage pool was to run Virtualbox VM’s off of it, by creating ZVOL’s (virtual block devices on top of ZFS) and passing them through to the VM to use as a raw block device instead of a disk file.

They perform OK, but nowhere near what I would have expected.

I ran some disk benchmarks inside a Windows 10 VM, after spending some time selecting the fastest virtual disk controller I could (which wound up being LSI SCSI emulation. There was an NVMe emulation driver, but it was very inconsistent)

These were the results:

------------------------------------------------------------------------------
CrystalDiskMark 8.0.6 x64 (C) 2007-2024 hiyohiyo
                                  Crystal Dew World: https://crystalmark.info/
------------------------------------------------------------------------------
* MB/s = 1,000,000 bytes/s [SATA/600 = 600,000,000 bytes/s]
* KB = 1000 bytes, KiB = 1024 bytes

[Read]
  SEQ    1MiB (Q=  8, T= 1):  4727.213 MB/s [   4508.2 IOPS] <  1766.81 us>
  SEQ    1MiB (Q=  1, T= 1):  3643.352 MB/s [   3474.6 IOPS] <   287.46 us>
  RND    4KiB (Q= 32, T= 1):   232.559 MB/s [  56777.1 IOPS] <   545.78 us>
  RND    4KiB (Q=  1, T= 1):    78.210 MB/s [  19094.2 IOPS] <    52.15 us>

[Write]
  SEQ    1MiB (Q=  8, T= 1):  1965.707 MB/s [   1874.6 IOPS] <  4189.91 us>
  SEQ    1MiB (Q=  1, T= 1):  2040.791 MB/s [   1946.2 IOPS] <   513.17 us>
  RND    4KiB (Q= 32, T= 1):   227.947 MB/s [  55651.1 IOPS] <   562.85 us>
  RND    4KiB (Q=  1, T= 1):    64.503 MB/s [  15747.8 IOPS] <    63.27 us>

Profile: Default
   Test: 1 GiB (x5) [E: 0% (0/50GiB)]
   Mode: [Admin]
   Time: Measure 5 sec / Interval 5 sec 
   Date: 2025/05/10 21:33:46
     OS: Windows 10 Pro 22H2 [10.0 Build 19045] (x64)

I mean, it’s not bad, but in a 4-way mirror of drives where each drive can read at 7,450 MB/s sequential, and in theory should scale almost linearly in this mirrored configuration, it is also less than 16% of the theoretical max…

I’m essentially getting a little bit more than single Gen3 drive performance out of four Gen4 drives in two striped mirror sets.

I knew to not get my hopes up too much, what with virtualization having some performance losses, and running a virtual block device on top of ZFS also not being the most performant solution, and there potentially being scaling issues due to CPU limitations both in the VM and on the host, etc. etc., but still this was kind of disappointing to me.

This is on a Threadripper 3960x with 128GB DDR4-3200 ECC RAM, btw.

I still use it for the other benefits of ZFS, but I was definitely hoping to get a little bit better performance out of it.

My take when it comes to ZFS and performance is that it can be a very well performing file system, if used on systems that are highly storage bottlenecked. ZFS does a lot of CPU computation to optimize things understanding that any given CPU core can do millions of computations in the time it takes to wait for a hard drive to finish. Thus, performance on hard drives is absolutely stellar (for hard drives). Performance on SATA SSD’s is quite good. But the faster your storage devices get, the less true the foundational assumption of ZFS (that the CPU is several orders of magnitude faster than the storage) is and ZFS starts to get bogged down in overhead.

I still love it and use it for its many features and high level of protection against corruption, but on NVMe drives it just isn’t going to be a high performance file system like it is on hard drives.

Oh this is going to be extremely dependent on your workload. Why don’t you tell us a little bit more about what you are trying to do?

NAS? Enormous video editing editing scratch disks? AI? Something else?

I may not be familiar with your exact workload, but at least it can give me some ideas.