cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: HTTP PUT performance issues

From: <RBramante_at_on.com>
Date: Mon, 9 Dec 2002 14:47:51 -0500

OK, I lied and I looked at this again today and I solved it (kinda).

The one thing that was different between curl and my test app was the size
of the buffer being passed to send(). In my test app it is 8k and in curl
it is CURL_MAX_WRITE_SIZE which is 20k. I didn't think much about this at
the time and figured if anything, curl was getting the benefit of using a
bigger buffer which I assumed was more efficient.

Well, I changed CURL_MAX_WRITE_SIZE to 8192 and rebuilt and reran
and.....the file put in < 2 seconds. My test cases went from spending 15+
seconds in select() to 1.25! Now curl is putting on a par with my test app
and the Java app. Just to come full circle, I changed my test app to use a
buffer of 20k and my puts went from taking < 2 secs to an avg. of 14. I
timed individual selects() and using a 20k buffer, the majority of select()
calls were taking ~200 milliseconds to complete. Using an 8k buffer, the
majority of select calls completed in ~15 millis.

So, the short of it seems that Win2k would prefer an 8k send size over a
20k send size given its druthers. Why this is or what sort of other
network magic is involved I am not sure of. Also, this is Win2k client and
server, so maybe the 20k sends are more an issue on the server side and
that is slowing down the client. Not sure. Maybe this final piece of info
will make sense to a network guru.

                                                                                                                                 
                      RBramante_at_on.com
                      Sent by: To: curl-library_at_lists.sourceforge.net
                      curl-library-admin_at_lists.sour cc:
                      ceforge.net Subject: RE: HTTP PUT performance issues
                                                                                                                                 
                                                                                                                                 
                      12/06/2002 01:07 PM
                      Please respond to
                      curl-library
                                                                                                                                 
                                                                                                                                 

I made one last ditch attempt to arrive at some sort of epiphany.

1) I tried the PUT using localhost. It still took me 16 seconds (this was
probably the weirdest result yet).
2) I built a dummy httpd that just read data as fast as it could. It took
16 seconds.
3) I made my dummy client use non-blocking i/o with selects. No noticable
depreciation in it's speed.
4) I rebuilt curl using gcc 3.2. The test still took 16 seconds.

Well, there is something to be said for consistency. I can't move 1.6 mb
in less than 16 seconds with curl.

I'm going to take a few days off from this. I think I've beaten it long
enough. Unfortunately I think I will have too revisit it again because the
throughput I'm seeing is going to become an issue.

If anyone in the community is using curl on W2K to HTTP PUT, I'd appreciate
any benchmarks you could provide for comparison. It would be nice to know
if this is a platform issue or just my issue :-)

                      Daniel Stenberg
                      <daniel_at_haxx.se> To:
                      libcurl Mailing list
                      <curl-library_at_lists.sourceforge.net>
                      Sent by: cc:
                      curl-library-admin_at_lists.sour Subject: RE:
                      HTTP PUT performance issues
                      ceforge.net

                      12/06/2002 03:09 AM
                      Please respond to
                      curl-library

On Thu, 5 Dec 2002 RBramante_at_on.com wrote:

> Why I am seeing this and why Daniel does not (my dummy app and curl
perform
> the put in the same time) for him is not clear. Maybe it is windows
> specific? Maybe it is some bizarre interaction between curl and this
> specific webserver (tomcat)? Maybe several factors specific to my
> environment?
>
> I'm out of ideas. It would be interesting if some other people took my
> dummy app and ran it side by side with curl and see what the results are.

I can't say I have many ideas left either.

Anyway, I took my tests one step further and fired up 'nc' on another
computer that sits connected to mine on a 100mbit ethernet (another Linux
host, this one a Celeron 600MHz), to check that it wasn't something weird
going on just because I was working on localhost.

The test results turned out very similar to those I saw before, with the
exception that the speeds were reduced due to the limited bandwidth.

They all perform at roughly 11MB/sec, which should be just about maximum
speed on this.

So to summarize: I just can't understand or repeat the results you're
experiencing.

--
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-12-09