doubianyan9749 2016-08-20 18:29
浏览 39

PHPSecLib Net_SFTP慢速传输

I am using Net_SFTP / phpseclib to upload files to a remote SFTP server. When uploading the test file from the sftp command line I average about 50Mbps. When uploading the same files from and to the same servers using PHPSecLib Net_SFTP I am only able to achieve about 17.0Mbps transfer rate.

Here is the code I am using for the transfer. I checked and there does not appear to be any CPU usage / networking bottle neck for the transfer. Any ideas on how to get the transfer rate up?

Note that I am using PHP version 5.6 and the newest version of phpseclib that I just downloaded from their site. I also verified that mcrypt is enabled via phpinfo().

Also running $sftp->getServerIdentification() results in

SSH-2.0-9.99 sshlib: 8.1.0.0

When connecting to the SFTP Server.

Here is the test code that only results in 17Mbps...

$port = 22;
$host = 'xxxxxxxxxxxxxx';
$user = 'xxxxxxxxxxxxxx';
$pass = 'xxxxxxxxxxxxxx';

$sftp = new Net_SFTP($host, $port);
if (!$sftp->login($user, $pass)) {
    exit('Login Failed');
}

$localFile = '000000.pdf'; //This is about a 300Mb test file
$ftpFile = '/Account/Testing/0000000.pdf';

$ftpResult = $sftp->put($ftpFile, $localFile, NET_SFTP_LOCAL_FILE);
$sftp->disconnect();
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题