Bad performance on NFS share, SMB works fine

Hi, I am running a new installation of TrueNAS Community Edition on my Proxmox host for testing purposes.

I already had problems with the speed of the NFS connection on my ‘old’ system (Core, on standalone hardware), so I have now installed the new system on a trial basis.

I have currently set up a pool of two hard drives. I have created two datasets on this pool. One for the NFS share and one for the SMB share.

When I connect via SMB and run a FIO test, I get a transfer rate of around 250 MB/s, which is fine. When I run the FIO test with the NFS share, I only get 7462 kB/s.

fio --name=write-test --size=1G --filename=fio-testfile --bs=128k --rw=write --direct=1 --numjobs=1 --time_based --runtime=30 --group_reporting

So far, I haven’t made any optimisations to TrueNAS. I just created users, created a pool, set up shares and then ran the tests.

What could be causing the problem with the NFS share?

Are you doing sync writes to the NFS share ?
The difference seems to be a bit too extreme, but try disabling sync writes in the options of the dataset.

1 Like

If i disable the sync, the performance is very good, around 250MB/s.

Currently i am lost about finding a valid solution. Does smb not sync data? What is the difference there between smb and nfs?

SMB is async NFS can be sync or async. If you don’t need your NFS client to sync writes then you can either disable sync on the dataset as @Farout has already said or tell your client not to mount sync.

1 Like

If your client needs sync you can add a slog (high write endurance low latency ssd with plp) to speed up sync writes

1 Like

Hi. Thank you very much for your answers, that explains the striking difference.

@LarsR discribed the technical solution if you NEED sync writes. If you dont know if you need it or not , chances are high you dont.

3 Likes

IIRC, Time Machine backups desire sync over SMB. Ditto some database operations.

Presumably, the file system is smart enough to let most stuff transfer on a async basis and only uses sync transactions when it’s required by the SMB user (ie Time Machine)?