NVMe/TCP instability, moved to iSCSI/SCST, now SGV allocation failures

Hi There :slight_smile:

Firstly I hope this post is in the right forum.

I’m looking for some advice on an ongoing storage issue between TrueNAS SCALE and a small Proxmox cluster.

The storage is a ZFS pool on TrueNAS, presented to Proxmox over 10GbE. The TrueNAS host originally had 16 GB RAM (I’m increasing this to 32 GB). There are currently around 8–9 Proxmox VM disks on the storage.

Original setup — NVMe/TCP

I originally used NVMe/TCP between Proxmox and TrueNAS.

Performance was excellent — sequential testing could get close to saturating the 10GbE link (~1 GB/s+) — but under certain workloads it became unstable.

On the TrueNAS side I was seeing errors along the lines of:

nvmet_tcp: failed to map data

and occasionally NVMe/TCP keep-alive/controller failures. During a Debian installation I also saw I/O WRITE errors inside the VM.

Interestingly, straightforward sustained tests could run successfully — for example a 16 GiB direct write at around 1.2 GB/s — so it didn’t look like a basic network throughput or disk performance problem. The failures seemed much more associated with particular/bursty workloads.

After spending quite a bit of time investigating that, I decided to remove NVMe/TCP from the equation and move the Proxmox storage to iSCSI.

Current setup — iSCSI / SCST

The same ZFS storage is now being exported from TrueNAS using its SCST-based iSCSI target.

Initially this looked much better and the VM storage has generally been working correctly.

However, during a Proxmox backup run at 02:00 I suddenly got large numbers of these messages on TrueNAS:

scst: Allocation of sgv_pool_obj failed (size 8388608)
scst: Unable to allocate or build requested buffer (size 8388608),
      sending BUSY or QUEUE FULL status

The Proxmox backup job was backing up several VMs from the TrueNAS iSCSI storage to another storage target. I’ve subsequently limited that backup job to approximately 500 MiB/s.

Initially I thought the backup simply overwhelmed the target, but I then saw another burst of exactly the same SCST errors at around 05:07, outside the scheduled backup window. That makes me think the backup exposed the problem rather than necessarily being its sole cause.

Some potentially relevant SCST settings are:

scst_max_cmd_mem:      3935
scst_max_dev_cmd_mem:  1574
scst_threads:          16

There are 9 SCST devices configured.

The individual VM devices are currently showing:

threads_num:          32
max_tgt_dev_commands: 64
threads_pool_type:    per_initiator
opt_trans_len:        33554432

The failed allocations themselves are consistently:

8388608 bytes

i.e. 8 MiB.

The SGV statistics show substantial activity across the per-CPU sgv-* pools, while the sgv-dma-* and cluster pools are essentially unused. For example:

sgv-3    Hit 95059    Total 95991
sgv-4    Hit 66318    Total 67390
sgv-6    Hit 58129    Total 59117

There are also significant numbers in big/other.

At the time I checked, this didn’t look like a userspace SCST service cgroup memory limit:

memory.max = max
memory.high = max
oom = 0
oom_kill = 0

and both iSCSI initiator sessions were still established.

What I’m trying to understand

What concerns me is that I’ve now seen two different target protocols exhibit problems when handling larger/heavier I/O workloads on the same TrueNAS machine:

NVMe/TCP: failed to map data / controller instability / VM I/O errors

iSCSI/SCST: failure to allocate 8 MiB SGV buffers, resulting in BUSY / QUEUE FULL

So I’m wondering whether these are actually two manifestations of the same underlying resource/memory-pressure issue rather than unrelated NVMe/TCP and SCST bugs.

The machine has 16 GB RAM. I’m going to increase this to 32 GB anyway. There are no VM or container workloads here - just storage and I did think 16 maybe ok here but appreciate ZFS likes its RAM

A few things I’d particularly appreciate opinions on:

  • Is 16 GB simply too little for this type of workload, particularly with several active VM LUNs and 10GbE?

  • Are the current scst_max_cmd_mem / scst_max_dev_cmd_mem values likely to explain the SGV allocation failures?

  • Would increasing those limits after installing 32 GB RAM be appropriate, and if so, what values would people recommend?

  • Is max_tgt_dev_commands=64 sensible for this workload?

  • Could the earlier NVMe/TCP failed to map data errors plausibly have been caused by similar kernel memory/allocation pressure?

  • Is there anything else I should capture when the SCST allocation failure occurs that would help establish exactly which resource is exhausted?

  • The storage network currently uses standard MTU 1500. I am considering moving the dedicated 10GbE storage path to MTU 9000. I don’t expect that to solve an 8 MiB SGV allocation problem directly, but would it materially reduce CPU/kernel/network overhead in this situation?

The underlying ZFS/storage performance appears healthy and the 10GbE network can sustain very high throughput when tested directly. The failures seem to occur when there is concurrent or bursty VM block I/O, rather than simply at a particular MB/s throughput.

I’m mainly trying to establish whether I should be looking at SCST queue/memory tuning, general kernel memory pressure, insufficient system RAM, or something deeper in the TrueNAS block-storage implementation.

Happy to provide additional SCST stats, /proc/meminfo, slab information, kernel logs, iSCSI session information, Proxmox configuration, etc. if useful.

Thanks :slight_smile:

What’s your pool topology?

Wasn’t the minimum requirement for iscsi 32GB and the more the better?

if thats documented I missed it :slight_smile: which is absolutely possible.

for the avoidance of any further possibility of this being an issue I’ve swapped my youngest child for a 16GB stick of RAM and threw it in!

16GB is the min and 32GB is recommended min for performance from the documentation, but I think you will still run into issues depending on your topology. VM’s are I/O heavy & if you have multiple VM’s queued up to write it’s going to run into errors.

I think you’ll need either an slog or a svdev to address the high I/O operations of multiple VM’s. Preferred topology would be multiple vdevs but you have to work with what you have. The extra ram will help, but I would still recommend using an ssd as an slog. Svdevs are nice but they are a permanent change to your pool where slogs are not.

Single TrueNAS ZFS SSD pool (ssd) exposing thin-provisioned ZVOLs under ssd/pve-storage as individual iSCSI LUNs to two Proxmox nodes. Each VM disk is its own ZVOL/LUN; iSCSI is SCST over TCP, with both Proxmox hosts connecting to the same target.

Hi - my topology is Single TrueNAS ZFS SSD pool (ssd) exposing thin-provisioned ZVOLs under ssd/pve-storage as individual iSCSI LUNs to two Proxmox nodes. Each VM disk is its own ZVOL/LUN; iSCSI is SCST over TCP, with both Proxmox hosts connecting to the same target.

Thanks :slight_smile:

I’ve upgraded to 32 now anyhoo

Thin provisioning may be your issue. You don’t mention the model of SSD, but you may be running into cache overflow and garbage collection on the SSD causing enough latency to trigger what you’re seeing.

I can reproduce what appears to be the same SCST issue on my TrueNAS system.

My setup:

  • TrueNAS 25.10.6

  • Linux 6.12.99-production+truenas

  • OpenZFS 2.3.4

  • 32 GB RAM

  • Proxmox VE initiators

  • iSCSI with multipath (two independent paths per LUN)

  • two iSCSI LUNs used for VM storage

Under I/O load, TrueNAS started producing a large number of these messages:

scst: Allocation of sgv_pool_obj failed (size 8388608)

scst: Unable to allocate or build requested buffer (size 8388608),

  sending BUSY or QUEUE FULL status

On the Proxmox side this eventually resulted in both multipath paths being failed, followed by write I/O errors to the device/filesystem. The paths later recovered.

This does not appear to have been a network path failure, because SCST on the TrueNAS side started reporting the allocation failures before the Proxmox multipath failures.

Some SCST parameters from my system:

scst_max_cmd_mem = 7997

scst_max_dev_cmd_mem = 3198

scst_threads = 4

Device parameters for both iSCSI devices:

threads_num = 32

threads_pool_type = per_initiator

max_tgt_dev_commands = 64

opt_trans_len = 33554432

Interestingly, the allocation failure is always for exactly 8388608 bytes (8 MiB).

At the time of investigation the system was not generally out of memory. With the default ARC behaviour I observed approximately:

Total RAM:       31.2 GiB

ARC: 22.9 GiB

MemFree: 5.6 GiB

MemAvailable: 6.3 GiB

There was no OOM killer event.

As a test, I temporarily limited ZFS ARC to 16 GiB:

echo 17179869184 > /sys/module/zfs/parameters/zfs_arc_max

After ARC shrank:

ARC:             ~15.7 GiB

Free memory: ~12.9 GiB

Available: ~11.8 GiB

I am currently repeating backup/I/O load tests with this ARC limit to see whether the SCST allocation failure returns.

If it does not return, this could point toward memory pressure/fragmentation interaction between ZFS ARC and SCST rather than simply insufficient total RAM.

I can provide the corresponding Proxmox multipath/iSCSI logs and additional TrueNAS SCST statistics if useful.

As stated by Samuel_Tai, this could be an issue of thin provisioning versus thick provisioning. Thin provisioning tries to allocate storage on the fly as it is needed where thick has it all pre-allocated. If you have a lot of I/O operations that are demanding new write space for the VM’s, it could cause this issue. I can’t replicate as I have a large sum of ram, though my VM’s are thick provision on hybrid stripped svdev with rust storage stripped vdevs. The backups are stored on a raidz2 pool.

@Glitch01 @Leon_Sinko

Apologies, I forgot to update this thread with my findings.

I’ve done quite a bit more testing since the original post and I’m now confident the underlying issue is ZFS ARC memory pressure / fragmentation, rather than thin vs thick provisioning.

I was originally seeing the problem with NVMe/TCP, where nvmet_tcp_map_data() was failing high-order allocations (order:5) despite the machine still having several GB of free/available RAM. Moving the same workload to iSCSI/SCST changed the symptom, but not the underlying behaviour — SCST then began failing its 8 MiB buffer allocations and returning BUSY/QUEUE FULL.

The useful clue was the kernel memory statistics: with unrestricted ARC, the 32 GiB machine had ARC up around 23–28 GiB, while compaction was working extremely hard and frequently failing. For example, I captured:

compact_stall   5268
compact_fail    5174
compact_success 94

So this wasn’t conventional “out of memory” — there was still free RAM and no OOM event — but the kernel was struggling to satisfy the allocations required by the storage target.

I capped ARC at 16 GiB (zfs_arc_max=17179869184) and repeated the same VM migrations, backups and concurrent heavy I/O that had previously reproduced the failures. This leaves substantially more memory available to the kernel and, so far, I have been unable to reproduce either the NVMe/TCP allocation failures or the SCST failures.

So at this point I’m comfortable saying ARC was the culprit on my system. Thin provisioning may affect the workload pattern and make the problem easier to trigger, but it wasn’t the root cause here.

For anyone hitting something similar on a 32 GiB SCALE system, I’d strongly suggest watching ARC size, /proc/buddyinfo, compaction counters and allocation failures under load rather than relying solely on MemAvailable.

Definitely worth documenting this as a caveat if you’re using iscsi or nvme targets.

hi, i have: grep -E “compact_stall|compact_fail|compact_success” /proc/vmstat compact_stall 104666

compact_fail 104662

compact_success 4

Thanks for this. I think I’m seeing the same thing running postgresql on my k3s cluster over iscsi to my TrueNAS SCALE 25.10.7 box. I’m seeing a ton of compact_fail and very few compact_success.

All my SCST devices show opt_trans_len = 33554432. The initiator shows max_hw_sectors_kb = 32764 and optimal_io_size = 8388608. Does anyone know where that number comes from? Is TrueNAS advertising something it can’t deliver?

Curious to see if you guys have any performance difference from zvol versus file for NVMe-oF/TCP. I recently swapped from zvol to file and noticed a 300 MB/s performance difference where file was faster than zvol.