Truenas VM access host NFS slow performance

I setup a debian VM in truenas Scale. I found that the nfs peformance is very bad. I compare the speed with simple dd command in truenas vm and raspberry pi4 to access truenas nfs

dd if=/dev/zero of=<nfs folder/file> bs=1G count=1 oflag=dsync

truenas vm speed is 49.1323 s, 21.9 MB/s
pi4 speed is 15.6201 s, 68.7 MB/s

pi4 is three times faster than truenas vm.
is there any suggestion to improve the performance?

Thanks

Funnily enough my racing car can drive 1/2 mile in 30 seconds, whilst my snail takes considerably longer.

The question is what are the times when done in a TrueNAS command shell compared to when done in the VM.

Also, to make an apples-vs-apples comparison, NFS shares will need to have the same:

  1. Local CPU power
  2. Network speed
  3. Remote CPU power
  4. Remote disk write speeds - which depends on the disk technology, and the file system being used.
  5. Same setting for async - NFS writes are normally synchronous unless the local mount, the remote mount or local/remote NFS settings have turned async on.

In essence, with async off, each write is committed to disk before you send a response back to the client. With async on, writes are put into the cache and immediately responded back without waiting for the physical write to disk. A 1GB file can easily be saved in ARC.

Thanks for your response.
The NFS server is running in TrueNAS. We compare the speed from nfs-client in pi4 and from truenas VM. Both pi4 and truenas VM are remote mount.

The speed is extremely slow when running dd command in truenas VM.
There are not many options available in setup NFS in trueNAS

Have you checked the two NFS mounts to confirm that they are both the same?