Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFTP uploading taking lot of time #11

Open
DorvakOff opened this issue Oct 9, 2022 · 11 comments
Open

SFTP uploading taking lot of time #11

DorvakOff opened this issue Oct 9, 2022 · 11 comments

Comments

@DorvakOff
Copy link

Hello, the uploading of files is taking too much time (4min39s) for only 45mb

  deploy:
    name: Deploying to the server
    runs-on: ubuntu-latest
    needs: [ compile-jar, update-version ]
    steps:
      - name: Restore the stored App from artifacts
        uses: actions/download-artifact@v2
        with:
          path: build
      - name: Moving files to root
        run: mv build/App/* ./
      - name: Clearing extras
        run: rm -r build
      - name: Listing files
        run: tree
      - name: SFTP Deploy
        uses: wangyucode/[email protected]
        with:
          host: ${{ secrets.SFTP_ADDRESS }}
          username: ${{ secrets.SFTP_USER }}
          password: ${{ secrets.SFTP_PWD }}
          port: 2022
          localDir: './'
          remoteDir: './'
          dryRun: false

image

@Elikill58
Copy link

Elikill58 commented Oct 13, 2022

I've same problem. With multiple files it's long.

Maybe zip files, then upload, then unzip can help ?

Took more 3m for me:

image

@wangyucode
Copy link
Owner

wangyucode commented Oct 15, 2022

TODO

  • Add an optional parameter zipBeforeUpload, to speed up the upload of many small files.

@DorvakOff
Copy link
Author

Actually it's only a "small" file that is taking a lot of time 😕

image

@ncgautomate
Copy link

my deployment taking like 30 minutes. Every time i push the code, it is trying to upload the same files. I have thousands of files. and it taking more than 30 minutes. I have used the parameter forceUpload: false

I tried to add the optional parameter, but got warning
https://prnt.sc/5jqqSuD2OJkd
can you add this parameter in the main branch?

any suggestions?

@ncgautomate
Copy link

each time I do PR, when the action runs, it keep pushing / uploading the existing files to SFTP server, even those files already exist. the app thinking each time i modify a single file and push, it thinks all of files in the app directory are new and trying to deploy them again. it's takes about 40 minutes to upload all those small files.

https://prnt.sc/Ty6eBNCtPjjS

how do i say only upload files are modified or newer?

@Amerlander
Copy link

Amerlander commented Nov 4, 2022

I have also set forceUpload: false but it uploads all files (the log says "uploading newer file:"…)

To minimize downtime, I thought about also uploading all files to a tmp folder, then move all existing files (except the ones in exclude) to another tmp and then move the new files in place and then delete the old tmp files. I think moving is often faster than deleting, and that could lead to a very short downtime.

Edit: my file sync is currently 11m for ~80mb and ~1000 files in ~100 folders.

@wangyucode
Copy link
Owner

wangyucode commented Feb 20, 2023

Regarding performance improvement, although uploading files is currently asynchronous, comparison files are synchronous.
TODO:

  • it is possible to read all remote and local files asynchronously to speed up the comparison process.

@wangyucode
Copy link
Owner

Regarding performance improvement, although uploading files is currently asynchronous, comparison files are synchronous. TODO:

  • it is possible to read all remote and local files asynchronously to speed up the comparison process.

Refactored in v2.0.0

@ApplecakeYT
Copy link

Can you make it so it stores like a sync-state file on the remote server so that the action already knows which files it has read remotely and doesn't have to reread files. This could save lots of time, especially on larger builds..

Something similar is done for FTP Deploy on https://github.com/SamKirkland/FTP-Deploy-Action for example. It stores a list in the remote server and only updates files that were changed.

@SedlarDavid
Copy link

Can you make it so it stores like a sync-state file on the remote server so that the action already knows which files it has read remotely and doesn't have to reread files. This could save lots of time, especially on larger builds..

Something similar is done for FTP Deploy on https://github.com/SamKirkland/FTP-Deploy-Action for example. It stores a list in the remote server and only updates files that were changed.

Feature like this will be much helpful since upload to limited server, without ssh access, when there is need for uploading around 10k project and dependencies files takes around hour.

@wangyucode
Copy link
Owner

If you have many files to upload, packaging them into tar.gz and notifying the server to download and decompress might be a better choice. Please refer to my new project, which is written in Rust, very lightweight and fast, and doesn't require a server key/password.
https://github.com/wangyucode/crane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants