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

link|improve this question

33% accept rate
feedback

1 Answer

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

link|improve this answer
transferring through curl command also takes more time . So it has nothing to do with http server i guess. – user26202 Jan 13 at 1:23
cURL uses your webserver, doesn't it? Can you past the cURL command you're using? – greut Jan 13 at 8:02
curl -F name=yyy -F filename=@/xxx/xxxxx/somefile.txt someurl.com – user26202 Jan 13 at 9: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 but you aren't in the example you gave me. – greut Jan 13 at 9:08
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.