Re: libcurl fread/send buffer size

2018-02-13 Thread Daniel Stenberg

On Tue, 13 Feb 2018, Biju N wrote:

can you share on what condition this calculation will be used to set the 
buffer size?


https://github.com/curl/curl/blob/d25b0503795f1fbf557632ce870298 
f52f2a78c1/src/tool_operate.c#L822


That's the curl tool that sets a smaller than its default (100K) buffer size 
if you ask for the transfer speed to be capped to a lower speed than so (per 
second). It's just a help to make it reach a stable speed faster, its not 
really necessary.


--

 / daniel.haxx.se
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: libcurl fread/send buffer size

2018-02-12 Thread Daniel Stenberg

On Mon, 12 Feb 2018, Biju N wrote:

Looking at the strace when it is run on a bare metal and a VM there is a 
difference in the file read/send buffer size. On bare metal it uses 16 KB 
and on VM it uses 8KB even though CURLOPT_BUFFERSIZE is not set explicitly. 
Process on bare metal seems to use the expected default of 16 KB and on VM 
it seems to be using a calculated optimal value. Is this the expected 
behavior?


No, that's not expected. libcurl uses the same fixed buffer size for all 
platforms and builds - unless the application changes it.


When I straced the curl tool just now to check how it looks, I could see it 
use a 100KB buffer in the recvfrom() call.


--

 / daniel.haxx.se
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html