cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: low performance uploading files

From: Juan Ignacio Hervás <jihervas_at_iies.es>
Date: Thu, 27 Mar 2003 13:25:36 +0100

Hi again,
I have modified the #define CURL_MAX_WRITE_SIZE from its original value
(20480) in curl.h and these are the results. I have tested with the same
file (714.484 Megabytes), first with the FTP server in the LAN, and second
with the wireless connection:

CURL_MAX_WRITE_SIZE FTP server in LAN FTP server in Wireless
20480 7600 KB/s 100 KB/s
20480*2 8400 KB/s 633 KB/s
20480*3 866 KB/s 250 KB/s
20480*4 620 KB/s 350 KB/s
20480*5 1030 KB/s 660 KB/s

I see that with CURL_MAX_WRITE_SIZE=40960, the transfer speed has been
improved in both cases. I also have done the same test connecting to a
remote FTP server through an ADSL link (128 K upload) and the transfer is
the same with CURL_MAX_WRITE_SIZE=20480 and CURL_MAX_WRITE_SIZE=40960: It
is about 10 KB/s.

My question is: CURL_MAX_WRITE_SIZE value can be modified or it will be
'dangerous'?

Thanks again.

At 20:27 26/03/2003 +0100, you wrote:
>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