Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

rryi

your hint was successful

Martin,

thanks alot for the reference of a similar problem. I adopted the reported solution, resulting in a speedup of > factor 10, reaching > 20MB/sec throughput.

No error in WinSCP assembly, nor the powershell wrapper module, it was my mistake/misunderstanding: the documentation at https://github.com/tomohulk/WinSCP mentions the default value of 15 seconds but states that the -timeout parameter needs type Timespan. An integer value for -timeout is not converted to seconds.
rryi

slow transfer, many log entries "host is not communicating for 0 seconds"

Hi,

I use WinSCP .NET assembly via the PowerShell wrapper tool https://github.com/tomohulk/WinSCP. Works fine, but throughput is extremely low. I would appreciate any tips to overcome the problem.

Details: I activated session logging, the log contains repeatedly these lines:
#
. 2024-11-13 16:58:49.033 Waiting for data timed out, asking user what to do.
. 2024-11-13 16:58:49.033 Asking user:
. 2024-11-13 16:58:49.033 **Host is not communicating for 0 seconds.
. 2024-11-13 16:58:49.033
. 2024-11-13 16:58:49.033 Wait for another 0 seconds?** ()
< 2024-11-13 16:58:49.033 Script: Host is not communicating for more than 0 seconds.
< 2024-11-13 16:58:49.033 Still waiting...
< 2024-11-13 16:58:49.033 Note: If the problem repeats, try turning off 'Optimize connection buffer size'..

I found a tip to turning off 'Optimize connection buffer size' here: https://winscp.net/eng/docs/message_host_is_not_communicating

I put the code line $option.AddRawSettings("SendBuf", "0") into my PowerShell script. However, it seems to have no effect. An upload of a file with size 860 KB took 70 seconds, the session log still contains the block of cited log lines, 32 times. The same upload, using WinSCP GUI, took < 2 seconds. In WinSCP GUI, "optimize connection buffer size" is checked - maybe the problem has another reason? I wondered about the "0 seconds" mentioned in the log. The timeout parameter is set to 60.

Here is the PowerShell code, sensitive data replaced by several "~". Attached as private file are the two log files of the 860 KB file upload. I found no other errors/warnings in the logs.
$option = New-WinSCPSessionOption -HostName "~~~.~~~.~~~.~~~" `
                                  -Protocol Sftp `
                                  -Credential $psCred  `
                                  -Timeout 60 `
                                  -PortNumber 22 `
                                  -SshHostKeyFingerprint "~~~~~~~~~~~~"
$option.AddRawSettings("SendBuf", "0")
 
$session = New-WinSCPSession -SessionOption $option `
                             -DebugLogLevel 2 -DebugLogPath "D:\ENTW\APP\OMS\TEMP\WINSCP_0002718132.log" `
                             -SessionLogPath "D:\ENTW\APP\OMS\TEMP\WINSCP_session_0002718132.log"
  (Send-WinSCPItem -LocalPath "~~~~~~~~~~" -RemotePath "/inbound" -Remove  -WinSCPSession $session).Check() # Exception bei Fehlern
 
Remove-WinSCPSession -WinSCPSession $session

system configuration:

  • Win server 2019
  • PowerShell 5.1.17763.6414
  • PowerShell wrapper WinSCP-PowerShell-v6.3.4.0
  • WinSCP .NET assembly 6.3.4.0
  • WinSCP GUI installation version 5.19.6
  • protocol sFTP