curl-library
Re: [PROF RFC 1/2] profiling of libcurl by curl-loader, steady state
Date: Thu, 19 Apr 2007 17:53:09 +0300
On 4/19/07, Daniel Stenberg <daniel_at_haxx.se> wrote:
> Using the multi interface it already shares connections and DNS cache
> automatically and then there's not much more to share. The easy struct has a
> bunch of variables for internal house-keeping and then there are the buffers:
>
> There are no less than three buffers allocated at CURL_MAX_WRITE_SIZE (16K),
> so 16*3=48K is "wasted" there already. You can of course:
>
> 1 - change the code to alloc the required buffer(s) once they're needed, as
> the upload buffer is rather pointless without uploads and I believe the
> master_buffer can be skipped if not using pipeline...
uploadbuffer is used for many cases PUT, POST, POSTFORM
and looks like for GET with https.
master_buffer is indeed used only, when pipelining is enabled,
so it is a good candidate to be allocated on demand.
> 2 - experiment with lowering the CURL_MAX_WRITE_SIZE value, but that might > of course also risk getting a slower throughput.
Y, we will use the below:
--------------------------------------
--- curl/include/curl/curl.h 2007-04-19 12:25:22.000000000 +0300
+++ curl/include/curl/curl.h.mod 2007-04-19 21:06:18.000000000 +0300
@@ -212,7 +212,9 @@
/* Tests have proven that 20K is a very bad buffer size for uploads on
Windows, while 16K for some odd reason performed a lot better. */
+#ifndef CURL_MAX_WRITE_SIZE
#define CURL_MAX_WRITE_SIZE 16384
+#endif
typedef size_t (*curl_write_callback)(char *buffer,
size_t size,
---------------------------------------------------
and pass via curl build configuration
CFLAGS="-DCURL_MAX_WRITE_SIZE=$(TRY_LOWERED_BUFSIZE)"
Thank you for your great advise.
-- Sincerely, Robert Iakobashvili, coroberti %x40 gmail %x2e com ................................................................... Navigare necesse est, vivere non est necesse ...................................................................Received on 2007-04-19