cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1188 slow upload on Windows

From: Andrew Kurushin <h00ligan_at_users.sf.net>
Date: Tue, 05 Feb 2013 16:50:28 +0000

i have made following changes according to the thread discussion:
[---]
Index: connect.c
===================================================================
--- connect.c (revision)
+++ connect.c (working copy)
@@ -846,12 +846,32 @@
    Buffer Size
 
 */
+#define DETECT_OS_NONE 0
+#define DETECT_OS_PREVISTA 1
+#define DETECT_OS_VISTA 2
+
 void Curl_sndbufset(curl_socket_t sockfd)
 {
   int val = CURL_MAX_WRITE_SIZE + 32;
   int curval = 0;
   int curlen = sizeof(curval);
 
+ OSVERSIONINFO osver;
+ static int detectOsState = DETECT_OS_NONE;
+
+ if (detectOsState == DETECT_OS_NONE) {
+ memset(&osver, 0, sizeof(osver));
+ osver.dwOSVersionInfoSize = sizeof(osver);
+ detectOsState = DETECT_OS_PREVISTA;
+ if(GetVersionEx(&osver)) {
+ if (osver.dwMajorVersion >= 6) {
+ detectOsState = DETECT_OS_VISTA;
+ }
+ }
+ }
+ if (detectOsState == DETECT_OS_VISTA) {
+ return;
+ }
   if(getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&curval, &curlen) == 0)
     if(curval > val)
       return;
[---]

and made several test with 3 custom builds of
curl 7.28.1 (i386-pc-win32) libcurl/7.28.1 OpenSSL/1.0.1c zlib/1.2.7 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS Largefile NTLM SPNEGO SSL libz

by uploading 70mb file from windows2k8r2 client to linux ftp and sftp server

ordinary(without sndbufset patch):
sftp=~6239Kbytes/s
ftp=~17.90Mbytes/s

with sndbufset patch:
sftp=~5629Kbytes/s
ftp=~19.1Mbytes/s

with CURL_MAX_WRITE_SIZE 491520:
sftp=21.4Mbytes/s
ftp=40.7Mbytes/s

---
** [bugs:#1188] slow upload on Windows**
**Status:** open
**Labels:** performance 
**Created:** Mon Feb 04, 2013 10:39 AM UTC by Andrew Kurushin
**Last Updated:** Mon Feb 04, 2013 01:27 PM UTC
**Owner:** nobody
my colleague experienced low ftp upload speed with curl(7.26, 7.28.1). ~500kb/s 
(win client to linux ftp server, both located in different countries so connection was not so ideal).
but at the same time upload speed through ordinary windows client(FileZilla) was much higher ~6mb/s.
finally we had tested ftp upload with farmanager which has ability to tune IO buffer size. by using 16k buffer we achieve same 500kb/s limit and than we specify 256kb IO buffer then speed goes up to ~6mb/s
curl upload speed is very sensitive to CURL_MAX_WRITE_SIZE. default 16kb is not enough. i have made custom curl build with increased buffer size upto 256kb and finally problem was resolved.
may be the root of problem is not in this value and only some internal upload pipeline should use increased value.
   
---
Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/curl/bugs/1188/>
To unsubscribe from further messages, please visit <https://sourceforge.net/auth/prefs/>
Received on 2013-02-05

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET