You are not logged in.

#1 2024-02-21 13:12:49

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Slow data transfer with samba, nfs and sshfs

Hi

Nautilus transfers data to/from a samba share at ~28 MB/s despite my network speed is good.
Both client and server machines run fully updated Arch Linux systems.

$ iperf3 -c 192.168.0.50 -bidir
Connecting to host 192.168.0.50, port 5201
[  5] local 192.168.0.20 port 58352 connected to 192.168.0.50 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  79.0 MBytes   662 Mbits/sec    0   3.90 MBytes       
[  5]   1.00-2.00   sec  82.9 MBytes   696 Mbits/sec    0   4.09 MBytes       
[  5]   2.00-3.00   sec  83.9 MBytes   703 Mbits/sec    0   4.09 MBytes       
[  5]   3.00-4.00   sec  80.4 MBytes   674 Mbits/sec    0   4.09 MBytes       
[  5]   4.00-5.00   sec  78.9 MBytes   662 Mbits/sec    0   4.09 MBytes       
[  5]   5.00-6.00   sec  83.6 MBytes   701 Mbits/sec    0   4.09 MBytes       
[  5]   6.00-7.00   sec  82.1 MBytes   689 Mbits/sec    0   4.09 MBytes       
[  5]   7.00-8.00   sec  81.6 MBytes   685 Mbits/sec    0   4.09 MBytes       
[  5]   8.00-9.00   sec  82.9 MBytes   695 Mbits/sec    0   4.09 MBytes       
[  5]   9.00-10.00  sec  85.4 MBytes   716 Mbits/sec    0   4.09 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   821 MBytes   688 Mbits/sec    0             sender
[  5]   0.00-10.02  sec   820 MBytes   687 Mbits/sec                  receiver

Any idea on how to improve the speed of data transfers to/from a samba share with nautilus?
Thanks.

Last edited by Strangiato (2024-02-27 16:36:08)

Offline

#2 2024-02-21 13:44:09

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

How's the throughput w/ not-nautilus, eg. w/ smbget or cp/rsync and an cifs mout?
Also: is this a cifs mount or are you using some gvfs implementation?

Online

#3 2024-02-21 14:03:40

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

I'm using gvfs. Nautilus copies from a cifs share at ~40 MB/s.

Offline

#4 2024-02-21 14:35:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

And not-nautilus?
(40MB/s is still only half the iperf throughput)

Could the disk IO on either end be the limiting factor (slow usb key etc)?

Online

#5 2024-02-21 15:18:00

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

The speed is unstable when copying from the cifs share with rsync, it varies between 28 MB/s and 68 MB/s until the data transfer is completed. Tested copying a 5.2 GiB file, the operation was completed in 1m40s.
SATA SSD (client) and HDD (server), both devices with low io, were used in the test.

Offline

#6 2024-02-21 16:11:03

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

So
-----------------------
Nautilus + gvfs: ~28MB/s
Nautilus + cifs: ~40MB/s
rsync + cifs: ~52MB/s w/ apparent cache stalls at the Nautilus + gvfs pace and close to maxing out (padding for transaction data)
iperf: ~80MB/s

… I'd try from => to tmpfs => /dev/null

Online

#7 2024-02-21 21:12:49

papavlos
Member
Registered: 2017-09-23
Posts: 69

Re: Slow data transfer with samba, nfs and sshfs

Cable or WiFi?

Offline

#8 2024-02-21 21:20:47

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

Wi-fi for client, cable for server.

@seth
Sorry, I don't understand what this means:

… I'd try from => to tmpfs => /dev/null

Last edited by Strangiato (2024-02-21 21:26:36)

Offline

#9 2024-02-21 21:27:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

You share a file in eg. /tmp and dd that from the cifs mount into /dev/null

dd bs=4M if=/path/to/cifs_tmp_share/big.file of=/dev/null oflag=direct status=progress

Online

#10 2024-02-21 21:30:24

papavlos
Member
Registered: 2017-09-23
Posts: 69

Re: Slow data transfer with samba, nfs and sshfs

Strangiato wrote:

Wi-fi for client, cable for server.

Can you connect the client by cable? You may suffer wireless interferences, so the throughput fluctuations.

Offline

#11 2024-02-21 21:46:46

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

@seth
Your command produces this output:

dd: failed to open '/dev/null': Invalid argument

@papavlos
The client is an old laptop with 10/100 ethernet adapter. This laptop has a wi-fi 6 (AX) adapter, and my modem/router is wi-fi 5 (AC).

Last edited by Strangiato (2024-02-21 21:47:38)

Offline

#12 2024-02-21 21:48:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

Edit: direct doesn't work w/ dev/null… sorry.

dd bs=4M if=/path/to/cifs_tmp_share/big.file of=/dev/null status=progress

Last edited by seth (2024-02-21 21:49:26)

Online

#13 2024-02-21 21:56:35

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

I got stable ~38 MB/s until the command was completed.

5809111040 bytes (5.8 GB, 5.4 GiB) copied, 153 s, 38.0 MB/s
1389+1 records in
1389+1 records out
5826543616 bytes (5.8 GB, 5.4 GiB) copied, 153.518 s, 38.0 MB/s

Offline

#14 2024-02-21 22:01:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

iperf3 -c 192.168.0.50 -bidir

Does that match the unidirectional results of iperf3?

Online

#15 2024-02-21 22:06:35

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

unidirectional results of iperf3:

$ iperf3 -c 192.168.0.50
Connecting to host 192.168.0.50, port 5201
[  5] local 192.168.0.20 port 54576 connected to 192.168.0.50 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  77.1 MBytes   646 Mbits/sec    0   3.93 MBytes       
[  5]   1.00-2.00   sec  84.9 MBytes   712 Mbits/sec    0   4.19 MBytes       
[  5]   2.00-3.00   sec  83.1 MBytes   697 Mbits/sec    0   4.19 MBytes       
[  5]   3.00-4.00   sec  85.4 MBytes   716 Mbits/sec    0   4.19 MBytes       
[  5]   4.00-5.00   sec  82.1 MBytes   689 Mbits/sec    0   4.19 MBytes       
[  5]   5.00-6.00   sec  81.9 MBytes   687 Mbits/sec    0   4.19 MBytes       
[  5]   6.00-7.00   sec  83.1 MBytes   697 Mbits/sec    0   4.19 MBytes       
[  5]   7.00-8.00   sec  78.9 MBytes   662 Mbits/sec    0   4.19 MBytes       
[  5]   8.00-9.00   sec  83.4 MBytes   700 Mbits/sec    0   4.19 MBytes       
[  5]   9.00-10.01  sec  85.9 MBytes   712 Mbits/sec    0   4.19 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec   829 MBytes   694 Mbits/sec    0             sender
[  5]   0.00-10.03  sec   829 MBytes   693 Mbits/sec                  receiver

iperf Done.

Offline

#16 2024-02-21 22:07:09

papavlos
Member
Registered: 2017-09-23
Posts: 69

Re: Slow data transfer with samba, nfs and sshfs

Strangiato wrote:

I got stable ~38 MB/s until the command was completed.

So apparently the cause is not in WiFi, as you have stable download stream. It must be somewhere locally on the client side.

It looks like @seth has a clue of what next now...

Offline

#17 2024-02-22 08:11:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

cifs is capping at 40MB/s and gvfs at 30MB/s and it's not the IP layer (or protocol, you're not running iperf3 on UDP, are you?)
https://wiki.archlinux.org/title/Samba# … throughput

Online

#18 2024-02-22 15:54:25

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

the command to run iperf on udp is different:

$ iperf3 -c 192.168.0.50 -u
Connecting to host 192.168.0.50, port 5201
[  5] local 192.168.0.20 port 55207 connected to 192.168.0.50 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   1.00-2.00   sec   127 KBytes  1.04 Mbits/sec  90  
[  5]   2.00-3.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   3.00-4.00   sec   127 KBytes  1.04 Mbits/sec  90  
[  5]   4.00-5.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   5.00-6.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   6.00-7.00   sec   127 KBytes  1.04 Mbits/sec  90  
[  5]   7.00-8.00   sec   129 KBytes  1.05 Mbits/sec  91  
[  5]   8.00-9.00   sec   127 KBytes  1.04 Mbits/sec  90  
[  5]   9.00-10.00  sec   129 KBytes  1.05 Mbits/sec  91  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.000 ms  0/906 (0%)  sender
[  5]   0.00-10.01  sec  1.25 MBytes  1.05 Mbits/sec  0.078 ms  0/906 (0%)  receiver

iperf Done.

Edit:
I added these lines to [global] section of /etc/samba/smb.conf file:

deadtime = 30
use sendfile = yes
min receivefile size = 16384
socket options = IPTOS_LOWDELAY TCP_NODELAY IPTOS_THROUGHPUT SO_RCVBUF=131072 SO_SNDBUF=131072

Restarted smb and nmb services, unmounted and remounted the samba share with nautilus, and the speed is still ~28 MB/s.

Last edited by Strangiato (2024-02-22 16:26:55)

Offline

#19 2024-02-23 22:27:50

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

I have another distribution called neon unstable, based on ubuntu 22.04, installed on the laptop. I have done the same tests with samba and cifs shares and rsync on it, and got similar low speeds. Dolphin file manager is a bit faster when copying from samba or
cifs shares, but the speeds are unstable, beginning at 25 MB/s and rarely reaching 65 MB/s.

I also have Windows 10 installed on the server machine, I shared the large file used in my previous tests on Arch client there. Dolphin copies this large file with speeds between 25 MB/s and 45 MB/s.

Looks like my modem/router is not good. sad

Last edited by Strangiato (2024-02-23 23:05:52)

Offline

#20 2024-02-23 22:48:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

Do you get higher throughput w/ eg. ftp, http or nfs?

Online

#21 2024-02-24 00:18:05

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

I have enabled the file sharing on Gnome insatalled on my laptop, so files in /home/Public folder can be shared over network.
Nautilus installed on the other machine copied the large file at 82 MB/s this time.

Offline

#22 2024-02-24 07:54:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,541

Re: Slow data transfer with samba, nfs and sshfs

From all I can tell, gnome just uses SMB?
So how does this related to the main situation (other devices, drives, connection types…)?

Online

#23 2024-02-24 09:49:20

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

Gnome shares the contents of /home/Public via webdav (http).

Offline

#24 2024-02-26 22:04:09

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

Now I'm testing NFSv4. Upload is fast, nautilus reports speeds between 80 and 160 MB/s, but download from the server is ~40 MB/s.
Similar results with rsync. Any idea why? And how to increase the download speed?

Edit:
Download is much slower than upload with sshfs too. Got these results with both nautilus and rsync:
download: ~30 MB/s
upload: ~70 MB/s

LTS kernel does not change anything too.

What else to do?

Last edited by Strangiato (2024-02-27 16:30:27)

Offline

#25 2024-02-29 12:44:38

Strangiato
Member
Registered: 2020-01-10
Posts: 521

Re: Slow data transfer with samba, nfs and sshfs

The command from beginning of the topic is wrong.
The correct argument is "--bidir", not -bidir".

 $ iperf3 -c 192.168.0.50 --bidir
Connecting to host 192.168.0.50, port 5201
[  5] local 192.168.0.20 port 60096 connected to 192.168.0.50 port 5201
[  7] local 192.168.0.20 port 60100 connected to 192.168.0.50 port 5201
[ ID][Role] Interval           Transfer     Bitrate         Retr  Cwnd
[  5][TX-C]   0.00-1.00   sec  30.6 MBytes   257 Mbits/sec    0   2.17 MBytes       
[  7][RX-C]   0.00-1.00   sec  28.8 MBytes   241 Mbits/sec                  
[  5][TX-C]   1.00-2.00   sec  26.6 MBytes   223 Mbits/sec    0   3.42 MBytes       
[  7][RX-C]   1.00-2.00   sec  23.6 MBytes   198 Mbits/sec                  
[  5][TX-C]   2.00-3.00   sec  38.5 MBytes   323 Mbits/sec    0   4.14 MBytes       
[  7][RX-C]   2.00-3.00   sec  24.8 MBytes   208 Mbits/sec                  
[  5][TX-C]   3.00-4.00   sec  31.9 MBytes   267 Mbits/sec    0   4.14 MBytes       
[  7][RX-C]   3.00-4.00   sec  22.9 MBytes   192 Mbits/sec                  
[  5][TX-C]   4.00-5.00   sec  27.6 MBytes   232 Mbits/sec    4   2.96 MBytes       
[  7][RX-C]   4.00-5.00   sec  22.1 MBytes   186 Mbits/sec                  
[  5][TX-C]   5.00-6.00   sec  18.8 MBytes   157 Mbits/sec    0   3.20 MBytes       
[  7][RX-C]   5.00-6.00   sec  13.0 MBytes   109 Mbits/sec                  
[  5][TX-C]   6.00-7.00   sec  18.2 MBytes   153 Mbits/sec    0   3.39 MBytes       
[  7][RX-C]   6.00-7.00   sec  13.9 MBytes   116 Mbits/sec                  
[  5][TX-C]   7.00-8.00   sec  20.6 MBytes   173 Mbits/sec    0   3.60 MBytes       
[  7][RX-C]   7.00-8.00   sec  15.1 MBytes   127 Mbits/sec                  
[  5][TX-C]   8.00-9.00   sec  20.9 MBytes   175 Mbits/sec    0   3.72 MBytes       
[  7][RX-C]   8.00-9.00   sec  15.0 MBytes   126 Mbits/sec                  
[  5][TX-C]   9.00-10.00  sec  41.2 MBytes   346 Mbits/sec    0   3.87 MBytes       
[  7][RX-C]   9.00-10.00  sec  21.8 MBytes   182 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID][Role] Interval           Transfer     Bitrate         Retr
[  5][TX-C]   0.00-10.00  sec   275 MBytes   231 Mbits/sec    4             sender
[  5][TX-C]   0.00-10.05  sec   274 MBytes   229 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec   204 MBytes   171 Mbits/sec  128             sender
[  7][RX-C]   0.00-10.05  sec   201 MBytes   168 Mbits/sec                  receiver

iperf Done.

I don't understand why upload with NFSv4 is fast, but download is slow.

Offline

Board footer

Powered by FluxBB