Extremely slow ssh/scp transfers

Status
Not open for further replies.

dniq

Explorer
Joined
Aug 29, 2012
Messages
74
Hello all!

I'm having a rather strange problem, when copying data from one FreeNAS 9.1.1 box to another, over WAN or VPN.

In the example below, nas1-ny is FreeNAS in New York, and nas1-ca is FreeNAS in California, and b101 is an Ubuntu server in California:

[root@nas1-ny] /mnt/export/vmware# scp ubuntu-12.04.3-server-amd64.iso b101:/dev/null
root@b101's password:
ubuntu-12.04.3-server-amd64.iso 100% 665MB 17.1MB/s 00:39
[root@nas1-ny] /mnt/export/vmware# scp ubuntu-12.04.3-server-amd64.iso nas1-ca:/dev/null
root@nas1-ca's password:
ubuntu-12.04.3-server-amd64.iso 1% 12MB 663.9KB/s 16:46

As you can see, transfer from nas1-ny to b101 over VPN tunnel goes at around 17 megabytes per second, while transfer to nas1-ca goes at about 600-700 kilobytes per second.

I have also tried to configure a port forwarding in California for SSH and tried to copy file over open internet, without the VPN, to the same effect.

Since ssh client can copy files to Ubuntu server at a normal speed, I can only assume there's something fishy going on with sshd server. And this presents a HUGE problem for me, as I'm setting up replication - at this pace it will never keep up with the new snapshots that need to be replicated :(

Any ideas why this is happening?

Thanks!
 

dniq

Explorer
Joined
Aug 29, 2012
Messages
74
Looks like scp from b101 to nas1-ca (within the same network) works at a normal speed... So I'm not sure whattaheck is going on :(
 

SmallGuy

Guru
Joined
Jun 7, 2013
Messages
560
Looks like this isn't a freenas issue:
Are you sure to have a symetric flow rate with your internet connection? I mean same flow in both direction (download /upload). This question apply to both california and NY internet connection.
 

dniq

Explorer
Joined
Aug 29, 2012
Messages
74
Looks like this isn't a freenas issue:
Are you sure to have a symetric flow rate with your internet connection. I mean same flow in both direction (download /upload)? This question apply to both california and NY internet connection.


Well, there is no difference when the data is being transferred from nas1-ny to b101 (Ubuntu server) in California and to nas1-ca... For some reason it's only nas1-ny to nas1-ca and vice-versa when the problem occurs :( I've checked all MTUs, MSS et cetera - I can't see what might be causing the problem :(

I have lagg (LACP) interfaces configured on both nas1-ny and nas1-ca, but can't imagine how that could cause these issues... Could be something with TCP settings in FreeNAS? TCP window, perhaps? Something else?
 

dniq

Explorer
Joined
Aug 29, 2012
Messages
74
Solved it!!!

sysctl net.inet.tcp.recvbuf_max=16777216
sysctl net.inet.tcp.sendbuf_max=16777216
sysctl kern.ipc.maxsockbuf=16777216
sysctl kern.ipc.somaxconn=1024
sysctl net.inet.tcp.sendspace=262144
sysctl net.inet.tcp.recvspace=262144
sysctl net.inet.tcp.sendbuf_inc=262144
sysctl net.inet.tcp.recvbuf_inc=262144
sysctl net.inet.tcp.syncookies=0

And now I'm getting about 10-20 megabytes/sec via scp! :)
 

moo083

Dabbler
Joined
Nov 9, 2015
Messages
28
Thank you from the future @dniq! I was getting 1.5 MB/s downloading files from a server that I get 5 MB/s downloading from a machine hooked into the same switch. After running those commands, all of a sudden my speed jumped to 5 MB/s.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Thank you from the future @dniq! I was getting 1.5 MB/s downloading files from a server that I get 5 MB/s downloading from a machine hooked into the same switch. After running those commands, all of a sudden my speed jumped to 5 MB/s.
Ha something is seriously wrong with your system. Getting 100MB/s should be easy with a normal freenas server. Please start a new thread with your problem.
 
Status
Not open for further replies.
Top