Page 1 of 1

Rate limit sftp upload

Posted: Mon Jun 02, 2014 1:42 am
by trumee
Hi,

I have limited upload bandwidth and so wanted to limit the upload bandwidth. I modifed line 810 in zmfilter.pl
from

Code: Select all

$sftpOptions{more} = [ '-o'=>'StrictHostKeyChecking=no' ];
to

Code: Select all

$sftpOptions{more} = [ '-o'=>'StrictHostKeyChecking=no', '-l'=>'40' ];
The -l 40 option to sftp will rate limit to 40 kbps.

Unfortunately, i get an error that connection to the server cannot be made. Anybody understand why this is happening?

The documentation at http://search.cpan.org/~salva/Net-SFTP- ... Foreign.pm mentions "Note that this option expects a single command argument or a reference to an array of arguments".

Re: Rate limit sftp upload

Posted: Sat Nov 28, 2015 11:33 pm
by trumee
Looks like this cannot be done. This is the response i got from the author of the per module
Limiting the bandwidth usage is a feature of the 'sftp' binary but Net::SFTP::Foreign runs 'ssh', not 'sftp'.

It is not currently possible to limit the sftp bandwidth when using Net::SFTP::Foreign.