> Am 17.03.2023 um 11:25 schrieb Nithin Das via curl-library 
> <curl-library@lists.haxx.se>:
> 
> Hi,
> 
> I am running into an issue where a curl client is timing out while 
> transferring a file to the server that uses lighttpd as the web server.  It 
> looks like the timeout is because of the setting on the lighttpd 
> (server.max-read-idle = 60) . The client is doing some background processing 
> during which the server times out.  One option is to increase the server 
> timeout value to a bigger number. I was wondering whether they are any 
> settings or options on the curl client side to prevent the server from being 
> timed out.
> 
> ## Time to read from a socket before we consider it idle.
> ##
> ## Default: 60
> ##
> server.max-read-idle = 60

Servers do this to protect themselves against a Denial-of-Service attack. So, 
in general, it is not wise to increase this timeout.

If you do a http: transfer that needs intensive processing on the client side 
(or accessing systems like a database where it is not certain how fast that 
responds), you should consider buffering the response. Or do the processing in 
a separate thread. Or start the processing only after the full response has 
been received. All depends on your application.

Both is more complexity on the client side, but I see no way around this. Curl 
cannot tell the server "I am a good client, please keep on waiting". 

Even if you use HTTP/2 and PING frames to keep the connection alive, servers 
will apply timeouts to your requests, e.g. the HTTP/2 streams you have opened.

Kind Regards,
Stefan

> -- 
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette:   https://curl.se/mail/etiquette.html


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
  • Read idle time out Nithin Das via curl-library
    • Re: Read idle time out Stefan Eissing via curl-library

Reply via email to