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 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog