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

smichelson

Re: Slow copy of large files using PowerShell module

The New-TimeSpan worked! The copy job completes in about 2–3 minutes now. Thanks so much for the tip!

For anyone else having this issue, here is what I did:
New-WinSCPSession -SessionOption (New-WinSCPSessionOption -Timeout (New-Timespan -Minutes 10))
martin

Re: Slow copy of large files using PowerShell module

You are using 3rd party WinSCP PowerShell module that we have nothing to do with.
But I believe that the -Timeout maps directly to WinSCP .NET assembly SessionOptions.Timeout property, which is of type TimeSpan, not an integer. I believe that PowerShell, when casting an integer to TimeSpan, uses Ticks (one ten-millionth of a second). So 600 might be indeed a very small timeout. Consider using New-TimeSpan instead of an integer.
smichelson

Re: Slow copy of large files using PowerShell module

Hey Martin, thanks for looking over the logs. Apologies for the inconsistent obfuscation, the remoteUser@remoteServer and userName@remoteHost accounts are referencing the same account being used to log into the remote server.

In my script I'm using the Timeout parameter for the New-WinSCPSessionOption cmdlet:
New-WinSCPSessionOption -Timeout 600

Is there some other timeout parameter I can set to change the "0" setting you mentioned?
martin

Re: Slow copy of large files using PowerShell module

You have timeout set to 0 in the PowerShell session. I'm not sure it's the actual problem, but it definitely doesn't help and it makes the log file mess.
Also, please obfuscate the log files consistently. I cannot know if remoteUser@remoteServer is the same thing as userName@remoteHost or not.
You also use different versions of WinSCP.
smichelson

Re: Slow copy of large files using PowerShell module

Ah, sorry about that, try these logs.
martin

Re: Slow copy of large files using PowerShell module

Please post complete session log files for both scenarios.

Your "PowerShell" log is debug log, not session log.
And your "GUI" log contains the file transfer only. We need complete session.
smichelson

Slow copy of large files using PowerShell module

Hello, trying to use the WinSCP PowerShell module to move large files (5-10GB) and copy speeds are very slow (less than 1 GB per hour). Tried moving the same files with the WinSCP Windows application and the copy completes in a few minutes. I've added logs for both PowerShell and Windows application jobs.