smart_open icon indicating copy to clipboard operation
smart_open copied to clipboard

ssh/scp/sftp: enable pipelining of write operations

Open mrk-its opened this issue 6 years ago • 4 comments

Turn on pipelining of write operations for ssh/scp/sftp

Motivation

It significantly speeds up writes. From paramiko docs:

When pipelining is on, paramiko won’t wait for the server response after each write operation. Instead, they’re collected as they come in. At the first non-write operation (including close), all remaining server responses are collected. This means that if there was an error with one of your later writes, an exception might be thrown from within close instead of write.

Popular sftp client library pysftp enables pipelining for put operations.

Result of simple benchmark

pipelining disabled:

Total time: 33.55 seconds, sent: 2621440 bytes, speed: 76 kbytes/sec

pipelining enabled:

Total time: 3.58 seconds, sent: 2621440 bytes, speed: 714 kbytes/sec

mrk-its avatar Nov 05 '19 15:11 mrk-its

@mpenkov could you take a look?

mrk-its avatar Nov 05 '19 17:11 mrk-its

Thank you for your contribution. Sorry it has taken so long for me to review this.

Please have a look at the comments and get back to me.

mpenkov avatar Nov 24 '19 09:11 mpenkov

@mrk-its Ping. Are you able to finish this PR?

mpenkov avatar Jan 08 '20 03:01 mpenkov

@mrk-its Ping. Are you able to finish this PR?

Yes, sure, I'll get back soon with changes.

mrk-its avatar Jan 16 '20 19:01 mrk-its

Closing as stale

mpenkov avatar Feb 22 '24 05:02 mpenkov