pysftp下载失败,因为客户端超出了服务器的内部缓冲区 [英] pysftp download fails because of client exceeded server's internal buffers

查看:96
本文介绍了pysftp下载失败,因为客户端超出了服务器的内部缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只需要从python脚本下载文件,因此代码很简单:

I need just to download a file from a python script, so the code is simple:

import pysftp
sftp = pysftp.Connection('test_host','test',password='test')
sftp.get('testfile', 'c:\\tmp\\testfile3')

下载将开始并以正常速度进行几秒钟,然后停止.没有更多下载,几分钟后服务器关闭了连接. 我要连接的服务器的管理员出于安全原因"不会透露服务器的任何详细信息,但写信给他,他可以看到这样的错误:

The download will start and proceed for a few seconds at normal speed and then stall. Nothing more is downloaded and after a few minutes the connection is closed by the server. The Admin of the server I am connecting to won't disclose any details of the server for 'security reasons', but wrote me that on his end, he can see an error like this:

SFTP错误发送,同时出现太多客户端请求.客户端已超出服务器的内部缓冲区.

SFTP error sending, too many simultaneous client requests. Client has exceeded the server's internal buffers.

我可以从python代码中做些什么吗?

Is there anything I can do about it from the python code?

推荐答案

这是MAX_REQUEST_SIZE问题的另一种体现,在此处的帖子中进行了描述:

This one is another manifestation of the MAX_REQUEST_SIZE problem described in a post here: Paramiko Fails to download large files >1GB

所以我也更改了 sftp_file.py :

MAX_REQUEST_SIZE = 32768

MAX_REQUEST_SIZE = 1024

神奇的是,问题似乎已经解决了.

and magically, the problem seems to be solved.

这篇关于pysftp下载失败,因为客户端超出了服务器的内部缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆