Samba – Why does the local network transfer speed decrease with larger files

file-transfernetworkingperformancesambascp

Short version: I have a Linux server (RHEL5) and a Windows 7 Professional laptop on a local wired network. Copying large files to the server gets gradually slower until it stops completely.

Long version

There is a Samba share on the server, which I can connect to, and I have read/write access.

All transfers from the server to the laptop work fine, but transfers from the laptop to the server seem to have their speed throttled, and sometimes fail completely.

Small files transfer ok, but files over about 2MB generally fail.

To test if this was a Samba issue or something else, I tried copying some files from the laptop to the server using scp (Putty's pscp). A 1MB file copies almost instantly, 2MB takes 3 minutes, and 3.7MB takes 18 minutes. So it is not specific to Samba.

Also, with both Samba and SCP I can copy several MB of very small files without issue.

What could be causing this behaviour? I would be very grateful for any advice.

Windows gives this error message:

There is a problem accessing H:\
Make sure you are connected to the network and try again

On the server, ifconfig shows some errors:

eth0      Link encap:Ethernet  HWaddr 00:22:19:AD:52:E2
          inet addr:192.168.1.7  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::222:19ff:fead:52e2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4125439 errors:72181 dropped:0 overruns:0 frame:0
          TX packets:3575918 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4481289749 (4.1 GiB)  TX bytes:581533090 (554.5 MiB)
          Interrupt:169 Memory:dfdf0000-dfe00000

/var/log/messages:

Aug 16 14:50:16 dev smbd[475]: [2013/08/16 14:50:16, 0] lib/util_sock.c:read_data(540)
Aug 16 14:50:16 dev smbd[475]:   read_data: read failure for 4 bytes to client 192.168.1.12. Error = Connection reset by peer
Aug 16 14:50:16 dev smbd[475]: [2013/08/16 14:50:16, 0] lib/util_sock.c:write_data(568)
Aug 16 14:50:16 dev smbd[475]:   write_data: write failure in writing to client 192.168.1.12. Error Broken pipe
Aug 16 14:50:16 dev smbd[475]: [2013/08/16 14:50:16, 0] lib/util_sock.c:send_smb(767)
Aug 16 14:50:16 dev smbd[475]:   Error writing 75 bytes to client. -1. (Broken pipe)

/var/log/samba/smbd.log:

[2013/08/16 14:50:16, 0] lib/util_sock.c:read_data(540)
  read_data: read failure for 4 bytes to client 192.168.1.12. Error = Connection reset by peer
[2013/08/16 14:50:16, 0] lib/util_sock.c:write_data(568)
  write_data: write failure in writing to client 192.168.1.12. Error Broken pipe
[2013/08/16 14:50:16, 0] lib/util_sock.c:send_smb(767)
  Error writing 75 bytes to client. -1. (Broken pipe)
[2013/08/16 14:50:16, 1] smbd/service.c:make_connection_snum(1077)
  liam-pc (192.168.1.12) connect to service external initially as user liam (uid=502, gid=502) (pid 529)

EDIT: If I boot into Ubuntu on the laptop I have no problem copying large files to the SMB share on the server. So the issue is either with Windows 7, or with the Windows 7/RHEL5 combination.

Best Answer

I ran service network restart and it seems to have fixed the problem. This seems a little strange, because the problem has been there with more that a year, and the server has been restarted several times since then. I copied a 365MB file to the server in 70s, averaging 5.2MB/s, with no error.

Related Topic