Upload large files with curl without RAM cache.

curlhdfshttp

I'm using curl to upload large files (from 5 to 20Gb) to HOOP based on HDFS (Hadoop Cluster) as follows:

curl -f --data-binary "@$file" "$HOOP_HOST$UPLOAD_PATH?user.name=$HOOP_USER&op=create"

But when curl uploading large file it trying to fully cache it in RAM wich produces high memory load. I've tried to use -N flag from man curl which should disable buffering. But nothing happened. So my question is, is there any way to force curl write directly to socket, or could you advice me another util which will cover my needs of simple HTTP POST/PUT requests.

I don't wont to write it by myself since it looks like inventing a bicycle all along. Thank you.

Best Answer

Sadly, according to Daniel Stenberg it's not currently possible.

See https://github.com/bagder/curl/issues/290