0

I am testing an IDL code on a server, which can be accessed by sending the appropriate URL to a Python script (something like this: http://example.com/pythoncode.py?arg1=val1&arg2=val2), changing the values of the arguments many times and reading the results provided by the IDL code via the Python script.

I run those tests from the Mac Terminal, using:

time curl -s - m 900 "http:...." > output.res

This does exactly what I want except that for some reason, the server seems to stop if the request takes more than 10 minutes (which it can). For instance:

real    10m0.126s
user    0m0.013s
sys     0m0.021s

And the output.res is:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>504 Gateway Time-out</title> </head><body> <h1>Gateway Time-out</h1>
<p>The gateway did not receive a timely response from the upstream server or application.</p> </body></html>

I first thought it was an issue with the --max-time, but I've now set -m 900 which gives the same result.

Question: am I doing something wrong with curl, or is it something to look on the side of the server?

Matt Ball
  • 354,903
  • 100
  • 647
  • 710

1 Answers1

0

curl's -m option sets the maximum time it'll spend. If it stops earlier than so, it was because of other reasons. The exit code will also show if it exited due to its own timeout or not.

In this case, you even got a friendly message output indicating that the problem was indeed the other end: "The gateway did not receive a timely response from the upstream server"

Daniel Stenberg
  • 54,736
  • 17
  • 146
  • 222