0

We have some running AWS EC2 servers, our clients use libcurl to send HTTP request (POST) to those server with their public DNS, the servers might be shutdown without notifying clients, then our clients need almost 50 seconds to finish a request and then get 504 error, does anybody know if there is a way to reduce this time to a few seconds?

Aladdin
  • 171
  • 8

1 Answers1

0

Curl has two parameters that let you tune your timeouts: --connect-timeout and --max-time

In your case, I guess --connect-timeout is the one you're looking for.

Beware: lowering this setting means you'll assume a timeout even if the backend servers are up and just take longer than usual to answer the request.

ffflabs
  • 17,166
  • 5
  • 51
  • 77