Code Monkey home page Code Monkey logo

Comments (11)

bandophahita avatar bandophahita commented on July 23, 2024 2

@carolinux are you comparing transfer speed of scp without compression to your code? I made the mistake of not setting client.connect(compress=True) so my transfers were considerably slower compared to my normal usage of scp -C

from scp.py.

remram44 avatar remram44 commented on July 23, 2024 1

Probably a paramiko issue 😢

Have you tried specifying a different buff_size?

from scp.py.

remram44 avatar remram44 commented on July 23, 2024 1

Last line:

scp_cli = scp.SCPClient(ssh_cli.get_transport(), buff_size=2*1024*1024)

from scp.py.

remram44 avatar remram44 commented on July 23, 2024

Are you talking about a single file? Multiple small files?

Have this ever been benchmarked?

from scp.py.

carolinux avatar carolinux commented on July 23, 2024

single file around 30 MBs.

from scp.py.

carolinux avatar carolinux commented on July 23, 2024
def get_ssh_connection():
    host = data_server
    ssh = SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.load_system_host_keys()
    try:
        ssh.connect(data_server, username="root")
    except:
        password = getpass.getpass("SSH password for {}@{} : ".format("root", data_server))
        ssh.connect(data_server, username="root", password=password)
    return ssh


def scp_to_server(local_filenames, remote_directory, skip_if_exists=True):
    ssh_cli = get_ssh_connection()
    scp_cli = scp.SCPClient(ssh_cli.get_transport())

Ok, where would I add the bufsize? Do I need a channel object and if so, how do I give to the SCPClient? (just in case it's convenient for you to answer, I will look at it later myself also)

from scp.py.

carolinux avatar carolinux commented on July 23, 2024

Thank you! I will report back when I benchmark it, because I think more people may find it useful.

from scp.py.

carolinux avatar carolinux commented on July 23, 2024

Bad news: I didn't perceive a difference one way or the other.

from scp.py.

john-dowling avatar john-dowling commented on July 23, 2024

any update on this, am having a similar issue

from scp.py.

remram44 avatar remram44 commented on July 23, 2024

(Oops)

I can't reproduce the issue, so it's pretty hard. It shouldn't be much slower, and if it is, that's probably an issue with Paramiko. But we can run more tests.

from scp.py.

remram44 avatar remram44 commented on July 23, 2024

I ran some tests and I really don't see much of a slowdown.

NYC MacBook to GCE: 14.605 / 14.248, French server to GCE: 13.114, 13.294

Data

MacBook (New York) -> Google Cloud (us-central1-c): 100MB

/usr/bin/scpscp.py
14.56315.142392
14.45914.081794
14.8414.152773
14.36214.174169
15.17514.07147
14.46514.245316
14.8414.053202
14.46414.059526
14.49713.943941
14.45314.419479
14.66214.142728
14.50513.978535
14.54414.187512
14.38314.549694
14.86514.518703

Online.net server (France) -> Google Cloud (us-central1-c): 15MB

/usr/bin/scpscp.py
4.35611.241386
10.04223.640888
8.80515.00032
5.7844.558009
6.61118.062356
23.20632.331319
30.93428.441495
16.55723.172128
28.78222.457937
37.94318.350743
3.142.257147
3.042.339132
3.1362.088671
3.0412.080863
7.6498.392694
10.07712.570131
12.09511.449674
11.2179.9099
14.23410.832424
18.75214.649188
17.1759.148867
13.6189.986314
10.29115.070032
14.2511.0324

If you see a really significant difference, do you mind sharing a bit more on your setup? Which OS? Is the machine CPU bound? High latency? Are you running on a very fast link?

from scp.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.