cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_READFUNCTION performance issue

From: Clemens Gruber <clemens.gruber_at_pqgruber.com>
Date: Sun, 28 Jul 2013 21:25:09 +0200

>> Is there any way curl could automatically detect when it would be appropriate to use this option by default?
>
> Not that I can think of. I would guess that it is hard for us to second-guess the TCP stack's behavior generically. I think we should start with considering some mention about this in the section where CURLOPT_READFUNCTION is described, but I'm not sure what to say...

Would be interesting to know if the Nagle algorithm improves libcurl performance at all. Maybe it does in some protocol handlers, but not in others.., etc.

A quote from Wikipedia: https://en.wikipedia.org/wiki/Nagle's_algorithm#Negative_effect_on_non-small_writes
> (…) If the response data can be larger than a packet, the responder must also disable Nagle's algorithm so the requester can promptly receive the whole response.
> In general, since Nagle's algorithm is only a defense against careless applications, it will not benefit a carefully written application that takes proper care of buffering; the algorithm has either no effect, or negative effect on the application.

Does curl take "proper care of buffering"? If yes, could it be beneficial to set CURLOPT_TCP_NODELAY per default?

Best regards,
Clemens
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-07-28