SFTP very slow in batchmode, very fast interactive mode

Issues related to configuring your network
Post Reply
steven.foo@idt.com
Posts: 3
Joined: 2017/11/10 07:39:58

SFTP very slow in batchmode, very fast interactive mode

Post by steven.foo@idt.com » 2020/03/05 08:17:16

Hi,

We have an issue one several centos servers where we tried to SFTP to another external server outside our company.

Interactive mode - human enter command.
- in this way, the transfer for 100MB file is very fast. We have no issue. Take 20-30 secs to complete.

sftp -vvv username@[sftp server name or IP]

Batch mode - script/passing of multiple commands.
- in this way, the transfer for 100MB file is very slow. Take hours to complete.

sftp -vvv -oBatchMode=no -b [script name] username@[sftp server name or IP]
or
sftp -vvv username@[sftp server name or IP] <<< $'cd /upload\n put mysqld.org'

Command enter manually and the one in the script file is the same.

Both are using the same file, ISP and line to the external site.

We have spend 3 days trying to test and figure out why. Still we have no idea why this is happen.
The firewall, there is no limit for port 22 to the external site.

Any idea why this is happening?

aks
Posts: 2958
Joined: 2014/09/20 11:22:14

Re: SFTP very slow in batchmode, very fast interactive mode

Post by aks » 2020/03/05 19:41:14

No.
The obvious difference is BatchMode. Does it make a difference if -b is - (stdin) and you copy and paste the batch? Could be buffer over/unser runs for example, well I guess a terminal is not "attached" in BatchMode.
Beyond that, take a deep breath and strace what's happening (and then send a day looking at the trace...)

Post Reply

Return to “CentOS 7 - Networking Support”