cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP PUT performance issues

From: <RBramante_at_on.com>
Date: Wed, 4 Dec 2002 21:59:29 -0500

Well,

I put a freeware ftpd on that windows machine and the xfer takes about 5
seconds, so the curl ftp xfer is abount 3x faster than the http one.

Very strange indeed. I also wrote a very dumb c app to do the http put
and tested that. Again, it takes ~2 seconds to do the 1.6. So both the
java app and my c app do it about the same. You can use it for testing.
There is no error checking and it breaks about 100 rules of network
programming, but it should serve its purpose for comparison.

I haven't looked at the xfer code yet so I am probably speaking out of turn
but...Since we spend so much time in select() I'm wondering how we do the
read/writes. For example for write (since this is the current problem)
when select() returns the socket as writable, do we do one send() and then
go back and select() again, or do we send() until we get an EWOULDBLOCK and
then go back and select()? If we are doing the former it might explain
some of the latency. The same would apply for recv(). If readable, recv()
until EWOULDBLOCK and only then go to the select(). Just a guess.....
(See attached file: httpput.c)

                                                                                                                                             
                      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/04/2002 02:27 PM
                      Please respond to
                      curl-library
                                                                                                                                             
                                                                                                                                             

On Wed, 4 Dec 2002, Rick Jones wrote:

> Perhaps the TCP window sizes are not the same in the FTP and HTTP PUT
> cases? Even for localhost that might have an effect on the transfer
speed.
> Similarly, the size of the buffers used for send or recv will have an
> effect on localhost transfers by altering the CPU utilization.

Well, curl never messes with options like that so I can't see how they
would
be different. Also, the send buffer is the exact same here in both cases.

In fact, *very* little differs between a HTTP PUT and a FTP STOR once the
data has started getting sent. Both ways is just a binary stream of data
being sent off as soon as the socket returns as writable from the select()
call.

RBramante, can you see the same effect that FTP upload performs "full
speed"
?

Personally, I don't have any other tool that does HTTP PUT to compare
speeds
with so I can't tell if it's just my server that is slow at receiving PUT.

--
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET
comprehensive development tool, built to increase your
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en

-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET
comprehensive development tool, built to increase your
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en

  • application/octet-stream attachment: httpput.c
Received on 2002-12-05