cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: low performance uploading files

From: <RBramante_at_on.com>
Date: Thu, 27 Mar 2003 08:05:43 -0500

If you go back and look through the Dec 2002 list archives for "HTTP PUT
Performance" you'll see a fairly long discussion of this. In summary, my
findings where that Windows did not like the default curl buffer size of
20K. When I changed the buffer to 8k and rebuilt curl I saw a noticeable
performance increase when sending data. Maybe you are seeing something
similar with FTP.

The latest curl code has changed this buffer size to 16K
(CURL_MAX_WRITE_SIZE in curl.h) Not sure what it is in the version of curl
you are using. You might want to check and if you can rebuild curl try
playing around with this size and see if it effects your uploads.

                                                                                                                                                   
                      Juan Ignacio Hervás
                      <jihervas_at_iies.es> To: curl-library_at_lists.sourceforge.net
                      Sent by: cc:
                      curl-library-admin_at_lists.sour Subject: low performance uploading files
                      ceforge.net
                                                                                                                                                   
                                                                                                                                                   
                      03/26/2003 02:27 PM
                      Please respond to
                      curl-library
                                                                                                                                                   
                                                                                                                                                   

Hi,
First, congratulations for your 5 years anniversary!
I am working in Windows XP in a C++ application trying to upload files
using curl-library (version curl-7.10.3-pre3) as an FTP CLIENT. I use
WarFTP 1.82.00-RC1 as the FTP server and I am having problems of  very low
performance (transfer speed) when I upload files to the server installed in
my office.

The FTP server is installed in a computer with a wireless card (22 Mbps)
connected to the office with an access point. I have tested the same
transfer with CuteFTP as the FTP client in order to compare the performance
with the curl-library when I transfer a very big file (714.484 Megabytes).

FTP Client:             CuteFTP Pro 2.0
time in transfer:       14 minutes
Speed:          830 KBytes/s

FTP Client:             My application with curl-library
time in transfer:       more than 1 hour
Speed:          100 KBytes/s

If I do the same test with the FTP server installed in one of the computer
of the LAN (10/100), these are the results:
FTP Client:             CuteFTP Pro 2.0
time in transfer:       70 seconds
Speed:          9,44 MB/s

FTP Client:             My application with curl-library
time in transfer:       90 seconds
Speed:          7,78 MB/s

I show you briefly the sequence I am using in my application:

curl = curl_easy_init ();
curl_easy_setopt (curl, CURLOPT_PORT, myPort);
curl_easy_setopt (curl, CURLOPT_USERPWD, login_password);
curl_easy_setopt (curl, CURLOPT_UPLOAD, TRUE);

sprintf (url, "ftp://%s/%s/", targetURL, target_upload_file);
curl_easy_setopt (curl, CURLOPT_URL, url);

curl_easy_setopt (curl, CURLOPT_VERBOSE, FALSE);
curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, error);
curl_easy_setopt (curl, CURLOPT_NOPROGRESS, FALSE);
curl_easy_setopt (curl, CURLOPT_PROGRESSFUNCTION, MyProgress);
curl_easy_setopt (curl, CURLOPT_PROGRESSDATA, pFileProgress);

curl_easy_setopt (curl, CURLOPT_READFUNCTION, MyRead);
curl_easy_setopt (curl, CURLOPT_READDATA, hfile);

curl_easy_setopt (curl, CURLOPT_INFILESIZE,  file_size);
curl_easy_perform (curl);

And my MyRead function is as simple as:

static size_t MyRead void *ptr, size_t size, size_t nmemb, void *stream)
{       return fread (ptr, size, nmemb, (FILE *) stream);
}

I have tested with and without PROGRESS info and the results are the same.
I have seen that the 'nmemb' parameter of 'MyRead' function is 20480 (I
suppose this should be the best size).

Is there any wrong parameter or bad configuration? or is there any way to
improve the transfer speed?

Thanks in advance.

-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
Received on 2003-03-27