cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcURL behaviour during upload in low bandwidth scenario

From: Mundwadkar, Gargi <Gargi.Mundwadkar_at_honeywell.com>
Date: Tue, 24 Feb 2015 03:06:29 +0000

Hi,
I have written application which is supposed to upload a file every 100 ms to server, using libcurl. My file size is variable but varies between 100KB to 700KB. I have 1Gbps betwork with me. I get upload bandwidth upto 9Mbps.
During this continuous upload, at one point of time, upload bandwidth suddenly drops low( as low as 72Kbps). At this time, curl gets blocked until specified timeout is over and it doesn't even form any request. ( I don't want curl to get blocked here.) The problem is, it informs about drop in bandwidth only after it comes out of this blocking period. Just before this blocking period, upload bandwidth for previous request was calculated as 9Mbps but, next moment, it dropped to 72Kbps . And curl informs about this drop in bandwidth only after it blocks for specified timeout period and comes out. I have 3 doubts about this behavior.

1. Why curl gets blocked here and doesn't form the request for the whole timeout period? Doesn't it try to upload chunk by chunk?

2. As I explained above, bandwidth suddenly drops very low, which I come to know only after request is completed. Is there any way to determine bandwidth before performing the request, so that I wouldn't go ahead for upload if bandwidth is low. Or is there any way I can stop curl from blocking if it doesn't want to form the request.

3. I read 2 options of libcurl recently, which are CURLOPT_LOW_SPEED_TIME and CURLOPT_LOW_SPEED_LIMIT. What I understand from definitions given on your site is, it defines lower level of bandwidth and monitoring time in secs. Is there something which specifies this in terms of mili secs.

My main intention is, curl should not get blocked if it is not performing any request. Is there any other configurable option for libcURL which I'm missing?

Regards,
Gargi

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-02-24