Extremely poor iSCSI performance | SSDs | Proxmox

I use TrueNAS SCALE 24.04.2.

Hardware: (Proxmox host)

  • Supermicro H13SAE-MF
  • AMD 7900X
  • 64 GB ECC RAM (KSM48E40BD8KI-32HA)
  • Network card: 10Gtek 10Gb SFP+ PCI-E x8 (Intel X520) - MTU 9000
  • System drive: SAMSUNG 990 PRO

TrueNAS VM:

  • 4 vCore (tried 10 as well)
  • 12GB RAM
  • Virtual system disk
  • PCI Passthrough - entire sata controller from the host
  • SATA controller: 4x SATA SSD Samsung 870 EVO 2TB
  • Network: VirtIO (paravirtualized)
  • Data VDEVs: 2 x MIRROR | 2 wide | 1.82 TiB (Usable Capacity: 3.51 TiB)
  • Main Dataset block size: 128k

image

Root dataset config:
Sync: DISABLED
Compression Level: LZ4
Enable Atime: OFF
ZFS Deduplication: OFF
Case Sensitivity: ON
Recordsize: 128k

iSCSI Zvol:
Type: VOLUME
Sync: DISABLED
Compression Level: OFF
ZFS Deduplication: OFF
Case Sensitivity: ON
Volblocksize: 16K (tested 4K as well)

iSCSI Extent
Logical Block Size: 4K (tested 512 too)
LUN RPM: SSD
Enable TPC: True
Xen initiator compat mode: False

No matter what I do, iSCSI speed is about 30-200MB/s.
I tried different block sizes for the LUN, different “Logical Block Sizes”.
I even tried PCI Passthrough one of the physical port to the VM and established direct wired connection between my PC (win11) and that port.
No luck, TrueNAS iSCSI implementation, seems, doesn’t work for some cases.

From the same instance of TrueNAS I get stable SMB speed 1.12 GB/s for the single file (20GB) transfer (without direct connection and router is used and still).
I also have a Synology DS923+ with a 10Gb NIC and 4 spinning rust drives in RAID 5.
DS923+ delivers stable 450-500 MB/s via iSCSI (even without direct connection).

Interesting thing though, while testing I decided to virtualize win11 to see what performance I will get if both the TrueNAS and win11 placed within Proxmox.
In this case, both virtual machines have a network connection with a throughput of about 30 Gbps.
For the test purpose, I used single VDEV with 4x drives in RAIDz1.
And the results are really strange - sometimes I saw iSCSI write speed about 1350MB/s, sometimes about 500, and sometimes really low.
I believe the iSCSI speed issue has something to do with how TrueNAS handles the network card.

No idea what to do.

could you describe exactly what your configuration is? from reading your post it seems like you have proxmox installed on top of truenas and have passed the controller through?
or is truenas on top of proxmox? or are they on separate machines?

this is the way proxmox is handling the transfer, it knows that the file is on the same disk and is essentially reassigning it from one VM to another. this is very common with virtualization environments.

I updated my first post.
Proxmox is a hypervisor and TrueNAS is a virtual machine.

Not the case. Proxmox does not own the SATA controller because of Passthrough. TrueNAS storage (4x SATA SSD) is not visible to the Proxmox in any way.
Win11 test VM was installed on the Proxmox virtual disk (file on the separate NVME disk).
Observed 30Gbit network connection (confirmed by iperf) I can explain by Intel NIC loopback feature.

Provides loopback functionality, where data transfer between the virtual machines within the same physical server need not go out to the wire and come back in, improving throughput and CPU usage.

I suspect this may be at least part of the bottleneck. SATA add-on cards are notoriously bad here. What is the exact model?

Integrated AMD controller.

SATA controller: Advanced Micro Devices, Inc. [AMD] 600 Series Chipset SATA Controller (rev 01)

How it could be if I get stable 1.12+ GB/s transfer speed using SMB protocol?
(from my main PC to the TrueNAS smb share)

image

Did you try disabling sync on the iSCSI volume?

thank you for updating the post. now that i understand your setup better, hopefully i can be of more assistance. so we know the truenas can get 1.12GB/s as we have a system that is able to achieve that. so there does not apear to be any issue on the networking side.

that leaves the ISCSI configuration. I have not tried iscsi on win11 myself so cannot speak to any differences the latest OS may have but it is possible that there is a setting that needs to be adjusted somewhere.
keeping in mind that iSCSI is handed out as a block device the filesystem is handled by the initiator. when connecting to the iscsi target, is the block device eagerly zeroed or lazily zeroed?
it is possible you are seeing additional overhead caused by the win11 system having to format the drive as it is being written.
there may also be some settings on the truenas side such as the sync/async setting mentioned by stux.
any compression, dedup or encryption may also be affecting it if these settings were left as default (mileage may vary here, depending on your default settings)

Thank you all for participating.

I updated first post with more details.
Sync is disabled.

In this case, the TrueNAS developers would be the first to know about it and the recommendations would appear in the documentation.
I also use Synology iSCSI from the same win11 machine - transfer speed is in the expected range (450-500MB/s) and quite stable.

I use “quick format” in Windows as usual. So it is lazily zeroed.
With Synology LUN quick format does not cause any visible slowdown.
If this is the source of TrueNAS iSCSI performance, it should recover on its own during testing, as I moved a 20GB file onto a 50GB LUN multiple times (not exceeding 50 GB of space).

It looks like the problem is somewhere outside of user exposed settings.
So, I have a plan to install TrueNAS on the same server (bare metal) and take a look.
Also, long term plan to install Intel x550-T2 card and test again.

It seems your iSCSI speed issue might be related to network configuration or TrueNAS SCALE’s handling of the NIC. Since SMB speeds are fine but iSCSI fluctuates, try switching to a more performance-tuned virtual NIC like Intel e1000 to see if VirtIO is the bottleneck. Ensure MTU 9000 is consistent across all network devices, including switches and initiators. Adjust iSCSI queue depth and session parameters on both TrueNAS and the initiator (Windows). Additionally, test whether PCI passthrough is causing instability by using the onboard NIC for comparison. These steps may help stabilize iSCSI performance.

1 Like

Will try, thanks.

Can you point out how to do this?

The onboard NIC is only 1Gb, so testing possibilities are limited.
And without PCI passthrough, I would be able to test only with virtual disks (hosted on the NVME SSD).
But anyway, it’s worth to try all options.

I just dug up the old ISCSI guide from the old forum, see Resource - The path to success for block storage | TrueNAS Community, which states that ISCSI needs at least 64GB of ram to perform somewhat good. MAybe try to increase the ram of the truenas vm.

2 Likes

You’re right that with a 1Gb onboard NIC, testing options are limited. Without PCI passthrough, you can only test with virtual disks (hosted on the NVME SSD). However, it’s still worth trying all available options as it may provide the best results

I decided to test on bare metal, so now the host machine is TrueNAS.
No Proxmox, no virtualization and passthrough, all 64 GB ram available.
I just installed TrueNAS and restored settings from the settings backup.

iSCSI:
Screenshot iscsi

SMB:
Screenshot smb

So, now I will try to reset all TrueNAS settings and perform clean TrueNAS setup.
Going to setup direct wired connection.
Later I will try intel X550-T2 NIC as well, just in case and combination of intel x550-T2 → x520-DA2.
If this will not help, then the issue is in TrueNAS itself.

I have read many discussions about TrueNAS iSCSI performance, everyone advises to increase RAM, try different settings, but maybe TrueNAS is not suitable for iSCSI due to zfs design, like it’s not good for SSDs.

For the record, TrueNAS systems (with more hardware) have been measured with iSCSI at:
18GB/s Read
7.5GB/s write (with sync enabled)

For 2 SATA Mirrors, I’d expect

1GB/s Read
400MB/s write

However, write speed is very sensitive to the slowest SATA SSD.
How full?
How worn out?
What brand?
How much queue depth?

This is a test i did on my 1.5 tib iscsi share on my ssd pool.
I had to manually set the allocation unit size in windows disk management. It was giving me very poor performance with it set to default.
it is slower over smb than iscsi

ISCSI

------------------------------------------------------------------------------
CrystalDiskMark 8.0.4 x64 (C) 2007-2021 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):   965.865 MB/s [    921.1 IOPS] <  8673.60 us>
  SEQ    1MiB (Q=  1, T= 1):   616.829 MB/s [    588.3 IOPS] <  1698.98 us>
  RND    4KiB (Q= 32, T= 1):   194.104 MB/s [  47388.7 IOPS] <   675.00 us>
  RND    4KiB (Q=  1, T= 1):    12.117 MB/s [   2958.3 IOPS] <   337.19 us>

[Write]
  SEQ    1MiB (Q=  8, T= 1):  1073.374 MB/s [   1023.6 IOPS] <  7795.48 us>
  SEQ    1MiB (Q=  1, T= 1):   788.135 MB/s [    751.6 IOPS] <  1329.62 us>
  RND    4KiB (Q= 32, T= 1):   227.744 MB/s [  55601.6 IOPS] <   574.37 us>
  RND    4KiB (Q=  1, T= 1):    11.876 MB/s [   2899.4 IOPS] <   344.59 us>

Profile: Default
   Test: 1 GiB (x1) [S: 26% (400/1536GiB)]
   Mode: [Admin]
   Time: Measure 5 sec / Interval 5 sec 
   Date: 2024/09/07 17:45:52
     OS: Windows 11  [10.0 Build 22631] (x64)

SMB

------------------------------------------------------------------------------
CrystalDiskMark 8.0.4 x64 (C) 2007-2021 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):   711.132 MB/s [    678.2 IOPS] < 11772.39 us>
  SEQ    1MiB (Q=  1, T= 1):   533.675 MB/s [    509.0 IOPS] <  1962.91 us>
  RND    4KiB (Q= 32, T= 1):   306.016 MB/s [  74710.9 IOPS] <   427.90 us>
  RND    4KiB (Q=  1, T= 1):    12.062 MB/s [   2944.8 IOPS] <   339.12 us>

[Write]
  SEQ    1MiB (Q=  8, T= 1):   646.766 MB/s [    616.8 IOPS] < 12925.87 us>
  SEQ    1MiB (Q=  1, T= 1):   604.555 MB/s [    576.5 IOPS] <  1733.01 us>
  RND    4KiB (Q= 32, T= 1):   251.517 MB/s [  61405.5 IOPS] <   520.28 us>
  RND    4KiB (Q=  1, T= 1):    11.808 MB/s [   2882.8 IOPS] <   346.47 us>

Profile: Default
   Test: 1 GiB (x1)
   Mode: [Admin]
   Time: Measure 5 sec / Interval 5 sec 
   Date: 2024/09/07 17:57:12
     OS: Windows 11  [10.0 Build 22631] (x64)

Not sure if it was mentioned, but did you check your drive write-caching?

Almost empty.
New
4x SATA SSD Samsung 870 EVO 2TB
Windows file copy (i don’t know which queue depth it use)

CrystalDiskMark 8.0.4 x64 (C) 2007-2021 hiyohiyo

  • 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): 413.222 MB/s [ 394.1 IOPS] < 20243.43 us>
    SEQ 1MiB (Q= 1, T= 1): 383.172 MB/s [ 365.4 IOPS] < 2735.69 us>
    [Write]
    SEQ 1MiB (Q= 8, T= 1): 399.738 MB/s [ 381.2 IOPS] < 20892.61 us>
    SEQ 1MiB (Q= 1, T= 1): 296.340 MB/s [ 282.6 IOPS] < 3536.59 us>
    –
    Profile: Default
    Test: 8 GiB (x1) [E: 0% (0/50GiB)]
    Mode: [Admin]
    Time: Measure 5 sec / Interval 5 sec
    OS: Windows 11 Professional [10.0 Build 22631] (x64)

Why? Dual mirror should provide 2x IOPS and with 64GB RAM, ARC can cache the entire file, isn’t it?

Interesting, because “default” is equal to the “iSCSI Extent Logical Block Size” - essentially, 512 or 4K.
When formatting with the “default” allocation unit size, Windows uses the exact value provided by TrueNAS.
So, can you specify, please, your:

  1. Main dataset recordsize (128K?)
  2. iSCSI Zvol Volblocksize (16K?)
  3. iSCSI Extent Logical Block Size (4K?)
  4. Selected Windows Allocation unit size - during format (4K?)
  5. TrueNAS network interface MTU value and windows NIC MTU value.

It seems OK.

for disk in /dev/sd?; do; hdparm -W $disk; done
/dev/sda:
 write-caching =  1 (on)
/dev/sdb:
 write-caching =  1 (on)
/dev/sdc:
 write-caching =  1 (on)
/dev/sdd:
 write-caching =  1 (on)

I’ve made a few changes (TrueNAS is still installed on bare metal)

  1. Direct wired connection from win 11 to the server
    (Asus XG-C100C V2 → RJ45 → Ubiquiti RJ45 to SFP+ → Intel x520-DA2.
  2. Disabled all offload features in the driver tab for XG-C100C V2 as well as power efficiency, interrupt moderation → low.

Here are the new results:

------------------------------------------------------------------------------
CrystalDiskMark 8.0.4 x64 (C) 2007-2021 hiyohiyo
------------------------------------------------------------------------------
* 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):  1187.242 MB/s [   1132.2 IOPS] <  7057.94 us>
  SEQ    1MiB (Q=  1, T= 1):   910.060 MB/s [    867.9 IOPS] <  1151.54 us>
  RND    4KiB (Q= 32, T= 1):   441.634 MB/s [ 107820.8 IOPS] <   296.64 us>
  RND    4KiB (Q=  1, T= 1):    52.926 MB/s [  12921.4 IOPS] <    77.23 us>

[Write]
  SEQ    1MiB (Q=  8, T= 1):  1231.283 MB/s [   1174.2 IOPS] <  6799.23 us>
  SEQ    1MiB (Q=  1, T= 1):  1034.603 MB/s [    986.7 IOPS] <  1012.81 us>
  RND    4KiB (Q= 32, T= 1):   379.163 MB/s [  92569.1 IOPS] <   345.00 us>
  RND    4KiB (Q=  1, T= 1):    57.461 MB/s [  14028.6 IOPS] <    71.15 us>

Profile: Default
   Test: 2 GiB (x2) [E: 0% (0/50GiB)]
   Mode: [Admin]
   Time: Measure 5 sec / Interval 5 sec 
     OS: Windows 11 Professional [10.0 Build 22631] (x64)

SMB (win11->TrueNAS):
smb

iSCSI (win11->TrueNAS):
iscsi

iSCSI (win11-> Synology DS923+ with 4x slow HDDs):
Synology

At this point I revert the TrueNAS installation back to Proxmox, as there is no sign of Proxmox contributing to iSCSI performance.

I have temporarily suspended the search for the problem.
In a month or more, I will test Intel X550-T2 NICs (on both sides - X550-T2 → X550-T2).

When you get back to testing, I’d suggest doing two things:

Increasing the zvol block size to 128K (If bandwidth is your primary goal)
Testing with fio or some tool that lets you control queue depth

As a side note: a NAS with 4 slow HDDs can’t write at 500MB/s and be reliable (what protection is used). If your test has less data than your NAS RAM, you can get artificially high numbers.

Tried already.

It’s up to 500, as graph shows, it fluctuates between 300-500.
Anyway, it’s great result for 4x 5200rpm HDDs in raid5.

The NAS only has 4GB of RAM compared to the 64GB TrueNAS test setup.
Anyway, I’m fine with the NAS using the HDD cache or speeding up transfers with the memory cache. Each device is connected to a UPS, and the chances of the DS923 freezing are low (but just in case, I use cloud backups for critical data).
I tried using TrueNAS with sync=disabled because there’s no way I’m writing data twice to the SSD (LOG+Actual write), I know that I can loose data for 5-6 seconds.