vscode-sftp
vscode-sftp copied to clipboard
Why is Upload / Download so slow?
I am connecting via FTP on port 21 to a micro EC2 instance on AWS.
Upload and Downloading files is hilariously slow. I would say both upload and download for 1 small text file takes 20 - 30 seconds.
Is this a bug, or is there something I can tweek?
Extension Logs from Startup - required
-
Open User Settings.
- On Windows/Linux - File > Preferences > Settings
- On macOS - Code > Preferences > Settings
-
Set
sftp.debug
totrue
and reload vscode. -
Reproduce the problem, get the logs from View > Output > sft
[info] config at c:\Users\mat01\xxxxxxxxxxx {"remotePath":"/","uploadOnSave":true,"downloadOnOpen":false,"ignore":[],"concurrency":1,"protocol":"ftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"passive":false,"remoteTimeOffsetInHours":0,"port":21,"name":"xxxxxxx","host":"xxxxxxx","username":"","password":""} [debug] < '220 (vsFTPd 2.2.2)\r\n' [debug] > USER ftpuser [debug] < '331 Please specify the password.\r\n' [debug] > PASS ****** [debug] < '230 Login successful.\r\n' [debug] > FEAT [debug] < '211-Features:\r\n' [debug] < ' EPRT\r\n EPSV\r\n MDTM\r\n' [debug] < ' PASV\r\n REST STREAM\r\n SIZE\r\n' [debug] < ' TVFS\r\n UTF8\r\n211 End\r\n' [debug] > TYPE I [debug] < '200 Switching to Binary mode.\r\n' [debug] > PASV [debug] < '227 Entering Passive Mode (81,98,222,74,4,22).\r\n' [debug] > NOOP [debug] > LIST / [debug] < '150 Here comes the directory listing.\r\n' [debug] < '226 Directory send OK.\r\n' [debug] > PASV [debug] < '227 Entering Passive Mode (81,98,222,74,4,19).\r\n' [debug] > NOOP [debug] > LIST /app [debug] < '150 Here comes the directory listing.\r\n' [debug] < '226 Directory send OK.\r\n' [trace] run command 'Edit In Local' [trace] handle download file for c:\Users\mat01\xxxxxxxxxx\app\Permission.php [debug] > PASV [debug] < '227 Entering Passive Mode (81,98,222,74,4,22).\r\n' [debug] > NOOP [debug] > LIST /app [debug] < '150 Here comes the directory listing.\r\n' [debug] < '226 Directory send OK.\r\n' [debug] > PASV [debug] < '227 Entering Passive Mode (81,98,222,74,4,10).\r\n' [debug] > NOOP [debug] > RETR /app/Permission.php [debug] < '150 Opening BINARY mode data connection for /app/Permission.php (390 bytes).\r\n' [debug] < '226 Transfer complete.\r\n' [debug] > MODE S [debug] < '200 Mode set to S.\r\n' [info] remote -> local c:\Users\mat01\xxxxxxxxxx\app\Permission.php
[debug] < '220 (vsFTPd 2.2.2)\r\n'
[debug] > USER ftpuser
[debug] < '331 Please specify the password.\r\n'
[debug] > PASS ******
[debug] < '230 Login successful.\r\n'
[debug] > FEAT
[debug] < '211-Features:\r\n'
[debug] < ' EPRT\r\n EPSV\r\n MDTM\r\n'
[debug] < ' PASV\r\n REST STREAM\r\n SIZE\r\n'
[debug] < ' TVFS\r\n UTF8\r\n211 End\r\n'
[debug] > TYPE I
[debug] < '200 Switching to Binary mode.\r\n'
[debug] > PASV
[debug] < '227 Entering Passive Mode (81,98,222,74,4,22).\r\n'
[debug] > NOOP
[debug] > LIST /
[debug] < '150 Here comes the directory listing.\r\n'
[debug] < '226 Directory send OK.\r\n'
[debug] > PASV
[debug] < '227 Entering Passive Mode (81,98,222,74,4,19).\r\n'
[debug] > NOOP
[debug] > LIST /app
[debug] < '150 Here comes the directory listing.\r\n'
[debug] < '226 Directory send OK.\r\n'
[trace] run command 'Edit In Local'
[trace] handle download file for c:\Users\mat01\xxxxxxxxxx\app\Permission.php
[debug] > PASV
[debug] < '227 Entering Passive Mode (81,98,222,74,4,22).\r\n'
[debug] > NOOP
[debug] > LIST /app
[debug] < '150 Here comes the directory listing.\r\n'
[debug] < '226 Directory send OK.\r\n'
[debug] > PASV
[debug] < '227 Entering Passive Mode (81,98,222,74,4,10).\r\n'
[debug] > NOOP
[debug] > RETR /app/Permission.php
[debug] < '150 Opening BINARY mode data connection for /app/Permission.php (390 bytes).\r\n'
[debug] < '226 Transfer complete.\r\n'
[debug] > MODE S
[debug] < '200 Mode set to S.\r\n'
Which part takes 20 - 30 seconds?
I think there are two operations here, a directory list, and a file download. Both are part of 1 action (edit file locally) from VSC. The whole lot took 20 to 30 seconds.
I'm afraid I don't know exactly which commands are the slowest - as you can see, there are no timestamps on the log.
there are no timestamps on the log.
But there are time gaps between each log.
[debug] > LIST /
[debug] < '150 Here comes the directory listing.\r\n'
Does the second line take 10s to show after the first one?
The biggest delay seems to happen after '227 Entering Passive Mode (81,98,222,74,4,21).\r\n'
Since there are 2 of these during one file fetch, I'm get 2x12 seconds delay.
Turn on Passive mode in your FTP server.
Valuable advice, thank you.
Here's an extract (last few lines) from my vsftpd .conf file.
pasv_enable=YES pasv_min_port=1024 pasv_max_port=1048
Since, there is no error message on the debug log after 'entering passive mode', surely we must assume that passive mode was successfully (although slowly) entered?
Furthermore - I've just tested our server by connecting to FTP via another client - WinSCP. This works flawlessly downloading a file in well under a second.
So, this all points to your extension not working properly (I guess that's not the case), or a setting within it being incorrect.
My config file in vscode is
{ "name": "xxx", "protocol": "ftp", "host": "xx.xx.xx.xx", "username": "username", "password": "password", "port":21, "remotePath": "/", "uploadOnSave": true }
Please advise.
Hello? Any word on this please?
Same problem, no error, just downloading 1 file every 10 seconds or so.
[debug] > PASV
[debug] < '227 Entering Passive Mode (185,216,26,23,117,96).\r\n'
[debug] > RETR /path/to/file.json
[debug] < '150 Opening BINARY mode data connection for /path/to/file.json (77 bytes)\r\n'
[debug] < '226 Transfer complete\r\n'
[debug] > MODE S
[debug] < '200 Mode set to S\r\n'
[info] remote -> local c:\path\to\file.json
I have a similar problem, taking up to 23 seconds to download a file. Using Filezilla, there is no delay at all.
This is where it hangs: [debug] < '227 Entering Passive Mode (xxx,xxx,xxx,xxx).\r\n' [debug] > RETR /public_html/xxx/xxx/xxxxxxphp [debug] < '150 Opening BINARY mode data connection for /public_html/xxx/xxx/xxx.php (575 bytes)\r\n'
About 18 seconds later it continues and completes:
[debug] < '226 Transfer complete\r\n' [debug] > MODE S [debug] < '200 Mode set to S\r\n' [info] remote -> local c:\wamp\www\xxx\xxx\xxx\xxx.php
As can be seen this is 600byte file
This problem occurs over many different servers.
I have just tested on my laptop and the problem starts once VSCode upgrades to 1.31.1 Jan 2019 Update
I have also tried this with NO other extentions loaded, to make sure that there is not a conflict somewhere. It still can take up to 35 seconds to fetch a 6k file when I open it locally. It is also liable to call data loss locally when you close the file before it downloads. I have a habit of hitting Ctrl S before closing anything and this saves a blank file.
My config is as follows:
{ "name": "SFTP Test", "protocol": "ftp", "host": "rem.ote.ser.ver", "username": "xxxxxxxx", "password": "*********", "port": 21, "remotePath": "/public_html/sftptest/", "uploadOnSave": true, "downloadOnOpen": true }
I have that problem too. Really weird.
Same problem Here. Problem appears only for remote->local(Download). For uploding Everything seems and works fine. Problem appears after the update to 1.31.1
Same problem here. In debug mode the longest delay is after "opening binay mode data connection".
[info] remote -> local d:\some.file [debug] > PASV [debug] < '227 Entering Passive Mode (xxxxxxxxxxxxx).\r\n' [debug] > RETR /domains/some.file [debug] < '150 Opening BINARY mode data connection for /domains/some.file (20126 bytes)\r\n'
Here it hangs for 5-60secs and it shows: [debug] < '226 Transfer complete\r\n' [debug] > MODE S [debug] < '200 Mode set to S\r\n'
And it goes to next file...
My vscode bersion is 1.31.1. Do anyone have solution for this?
Same here. All downloads go to PASV mode and every action on the server i.e. Opening BINARY mode data connection for [...] takes forever. Hosting and therefore FTP-Server is at Checkdomain.
Hello, same problem for me. Loooong delay before downloading from server. But for the same server, really fast on Filezilla. Weird.
Same here. Super fast on other FTP client.
same here, taking very long time every file download. i'm using vscode version 1.32.3-1552607091.el7 on fedora 29
same here, taking very long time every file download. i'm using vscode version 1.32.3-1552607091.el7 on fedora 29
Problem solved by down grade my vscode version to 1.30.2-1546901769.el7.
@liximomo do you have any update on this issue?
I have the same issue. Great plugin but the download speed is very slow. I hope you manage to fix it. Thank you very much in advance.
@liximomo I found out that it has something in common with the project I use. If project is relatively small (or not regularly opened) then it works ok. If project is big then it happens to download files very slowly. I have no idea if it can be related to other plugin like 'intelephense' but other plugins work without issues.
What if is this a problem with operating system? Maybe firewall. I'm using Windows 10. I also tried FTP-Sync addon and the speed is also very slow.
The same problem. MacOS Mojave.
Same problem here. Any project takes ages to download either a single file or a directory of files etc.
Whether SFTP or FTP...
My case seems related, i hope this helps fix this. I'm connecting to a m4.2xlarge in amazon. This is what's happening to me:
[debug] < '150 Opening BINARY mode data connection for /public_html/xxxxxx/xx.php (5713 bytes)\r\n'
The file appears in the folder almost instantly and i can open it with another editor checking is full downloaded
10-20 seconds waiting
[debug] < '226 Transfer complete\r\n'
The file opens in vscode.
An extension in which the maximum number of installations has such a serious compatibility problem with vscode 1.31 and higher is sadness ... in fact, it is impossible to use the extension because of downloading a small file in 20-30 seconds.
Same problem on VSCode 1.33.1 The problem is observed in Remote -> local mode. In the opposite direction, everything happens without any trouble. Tried to use VSCode 1.34.0-insider - the problem is the same.
Downgrading to version 1.30.2 solves the problem. Do not forget to turn off automatic updates.
Yeah downgrade to 1.30.x solved for me also...
Any chance soon to solve this problem with compatibility ??? Thanks and send much love ;)
@krzysmierz It seems that this is related to vscode. 🤔