cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How long a connection is persisted if period of inactivity

From: Pierre Morel <pmorel_at_gmail.com>
Date: Thu, 18 Mar 2010 21:26:15 +0000

On 18 March 2010 18:55, Pierre Morel <pmorel_at_gmail.com> wrote:
> I'm using libcurl to access a web service and for efficiency, trying
> to reuse connections. It's all working fine when I perform request
> after request without too long delay.
>
> However, if there is a period of inactivity (no call to
> easy_curl_perform or any curl function) of more than 15 seconds, then
> the request takes a lot longer (basically instead of an average 70ms,
> it's 350ms and as soon as the internet is slow, it increases from
> 300ms to 2-3seconds).

Ok, I think I found the cause of the problem: the server is actually
returning the keep-alive timeout in the header and it is set to 15
seconds/100 requests (which is the apache default). Changing it to
another value proves it's the cause of the problem.

Now, I need to see how I can circumvent this as I don't really want to
change the server settings (I need it low anyway because I have
numerous clients accessing the service). I also need to check why I
don't see the same thing on Windows.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-18