0

We recently moved to a new server. We have observed that the file upload done from the ftp command is taking around 5sec for 5MB file. But same file uploaded through CURL command is taking about 140 seconds. Any idea what could be wrong here ?

Cheers M

Vidya
  • 347
  • 1
  • 6
  • 19

1 Answers1

0

Uploading through FTP means transferring binary data directly to the filesystem using TCP.

Uploading throught cURL means transferring base64 encoded data (1.5x bigger) to the web server using HTTP (which uses TCP). The web application might create a 5MB memory object and then write it on disk, somewhere (it depends a lot on your application).

Do you know how is handled the upload on your HTTP server?

Nginx has a pretty decent module for that: nginx upload module

greut
  • 298
  • 2
  • 12
  • transferring through curl command also takes more time . So it has nothing to do with http server i guess. – Vidya Jan 13 '12 at 01:23
  • cURL uses your webserver, doesn't it? Can you past the cURL command you're using? – greut Jan 13 '12 at 08:02
  • curl -F name=yyy -F filename=@/xxx/xxxxx/somefile.txt http://someurl.com – Vidya Jan 13 '12 at 09:01
  • now, add `-v`, like `curl -v -F name=yyy…` you'll see that HTTP (and thus your webserver) is used. Apparently you can use [FTP with curl too](http://www.cs.sunysb.edu/documentation/curl/index.html) but you aren't in the example you gave me. – greut Jan 13 '12 at 09:08