cURL / Mailing Lists / curl-library / Single Mail


Re: sftp and buffersize

From: Jonas Schnelli <>
Date: Mon, 17 Oct 2011 17:12:59 +0200

> On Mon, 17 Oct 2011, Jonas Schnelli wrote:
>> But is there a chance to change the default 16K buffer to different value? Didn't found it straight away in the libcurl source. I just wan't to play with the buffer size to see how's the improvement and then decide to keep or through out sftp support in my software (for now :) ). Or can i somehow hack/change the buffersize in libcurls sftp.c?
> Set CURL_MAX_WRITE_SIZE to perhaps 100K or something and rebuild libcurl and see what difference it makes. It is defined in include/curl/curl.h


Just for the records:
changing the CURL_MAX_WRITE_SIZE to 128K had doubled upload speed on libssh2 1.3.0 on my setup.
changing the CURL_MAX_WRITE_SIZE to 512K i reach ~ my network max or - better say - the limits i get with openssh or other sftp clients-

setup: 32bit / intel
Network: 100MBit down / 8 MBit up

Is the CURL_MAX_WRITE_SIZE anyhow configurable? (you already said no, aren't you? :) )
Is it difficult to make the CURL_MAX_WRITE_SIZE anyhow configurable?

I would then try to change the CURL_MAX_WRITE_SIZE (of let's say the SFTP buffer size) dependent on the historical speed of the nework (or maybe also configurable by the enduser: like "select your internet connection type:").


> -- 
> /
> -------------------------------------------------------------------
> List admin:
> Etiquette:
include7 AG
Jonas Schnelli
Grngasse 10
CH-8004 Zrich
Office: +41 44 500 16 70
Skype: jonas.schnelli
Bitte senden sie uns keine sensitiven Daten in unverschlsselten E-Mails.
Verwenden Sie hierzu folgenden Link:

List admin:
Received on 2011-10-17