Http.onrequest response timeout

What is the maximum time for an http request response?

I find that the server responds with an empty response after 1 minute.
I am performing an operation which takes about 3 minutes and would like to respond after this time.

Is it possible to increase the automatic response timeout?

Toby

@TheBarrelShifter , I suppose that normally response are as soon as possible after request. 3 minutes are to long for “normal” response.
It is possible to include in response perviously made request task (in your case - result 3 minutes earlier) or set agent to post to another webpage.

I believe we have a 10 minute timeout. What are you using to make the request? That may be timing out…

I timed the request with Chrome, and also using Curl from the command line, both time out after exactly 1 minute.

Toby

@TheBarrelShifter - typically HTTP response times are set by the client making the request. In this case, the agent isn’t responding with a “timeout” - it simply isn’t responding the expected time.

You can change the timeout in a Curl command by adding the –max-time {seconds} parameter.

If you expect your process to take about 3 minutes, I would give it a 5 minute-ish timeout? Your Curl command would look something like this:

curl https://agent.electricimp.com/agentUrl --max-time 300

Thanks beardedinventor for your suggestion.

Unfortunately this doesn’t work though. I added the --max-time 300 to the end of my curl statement just like in your example, but after exactly 1 minute I still get an empty reply from the server…

curl: (52) Empty reply from server

The fact it gets a reply from the server suggests to me that the problem is on the agent end, and that the timeout is 1 minute rather than 10 minutes. Hugo, are you able to confirm your belief that the timeout is 10 minutes?

Toby

There’s definitely a one-minute timeout somewhere at the EI end. If you have wireshark running when issuing the curl command, you see the server sending a FIN (i.e., closing the socket) after about a minute.

Increasing that timeout doesn’t seem unreasonable, but it sounds like we need to find it first!

Peter

Thankyou for the confirmation Peter.

Toby

Ah, I’m getting confused with our outbound timeout, which is 10 minutes…