ansible / ansible/pylibssh

SFTP extremely slow with libssh

Open
#500 7 comments 0 reactions 2 assignees Claimed by @webknjaz View on GitHub
Dominant language
Cython
Stars
79
Forks
47
Avg merge
1d 11h
Merged PRs (30d)
6

Description

I did not see this specific issue reported yet. But this issue is similar https://github.com/ansible/pylibssh/issues/208

##### SUMMARY
I am using net_put module with protocol sftp to push software file to a Juniper SRX. The transfer is extremely slow (16min for 400MB file) when it uses the libssh but is very quick with paramiko. (30 seconds). I also verified that a manual sftp from the same ansible server to same destination was quick, so its not the network path, the issue is with the net_put module.

##### ISSUE TYPE
- Bug Report

##### PYLISSH and LIBSSH VERSION

ansible-pylibssh 1.1.0

ansible --version
ansible [core 2.14.5]
config file = /home/andy/ansible.cfg
configured module search path = ['/home/andy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /home/andy/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] (/usr/bin/python3)
jinja version = 3.0.3
libyaml = True

##### OS / ENVIRONMENT

Target OS:
vSRX runing Junos: 22.2R2.10
Also have seen same issue with WTI ([Western Telematic) console servers.

##### STEPS TO REPRODUCE
I am able to reproduce this issue my running the below playbook:

- hosts: FW-01
tasks:

- name: PUSH TEST FILE TO DEVICE
ansible.netcommon.net_put:
src: /home/software/juniper/junos-srxsme-22.1R3.9.tgz
dest: /var/tmp/junos-srxsme-22.1R3.9.tgz
protocol: sftp
vars:
ansible_connection: network_cli
ansible_network_cli_ssh_type: paramiko ### FAST WHEN PARAMIKO IS ENABLED, SLOW WHEN I REMOVE THIS.

##### EXPECTED RESULTS
I expect pylibssh to not take way longer than it should to transfer file.

##### ACTUAL RESULTS
pylibssh takes about 16minutes longer than paramiko for 400Mb file

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.