今のところ実際には何も見つかりませんでしたが、curl
は本当です 本当にタイムアウトしませんか?
[email protected]:~# curl http://localhost/testdir/image.jpg
testdir
内の画像のリクエストをリダイレクトしているので、質問しています それらの画像をその場で生成する別のApacheモジュールに。写真が実際に準備され、要求元のクライアントに配信されるまでに最大15分かかる場合があります。
curl
常に待機しますか(または構成によって異なりますか)、それとも何らかのタイムアウトがありますか?
承認された回答:
はい。
タイムアウトパラメータ
curl
2つのオプションがあります:--connect-timeout
および--max-time
。
マンページからの引用:
--connect-timeout <seconds>
Maximum time in seconds that you allow the connection to the
server to take. This only limits the connection phase, once
curl has connected this option is of no more use. Since 7.32.0,
this option accepts decimal values, but the actual timeout will
decrease in accuracy as the specified timeout increases in deci‐
mal precision. See also the -m, --max-time option.
If this option is used several times, the last one will be used.
および:
-m, --max-time <seconds>
Maximum time in seconds that you allow the whole operation to
take. This is useful for preventing your batch jobs from hang‐
ing for hours due to slow networks or links going down. Since
7.32.0, this option accepts decimal values, but the actual time‐
out will decrease in accuracy as the specified timeout increases
in decimal precision. See also the --connect-timeout option.
If this option is used several times, the last one will be used.
デフォルト
ここ(Debianの場合)では、--connect-timeout
で指定された時間に関係なく、2分後に接続の試行が停止します。 デフォルトの接続タイムアウト値は5分のようですが DEFAULT_CONNECT_TIMEOUT
によると lib/connect.hのマクロ。
--max-time
のデフォルト値 存在しないようで、curl
最初の接続が成功した場合は、応答を永久に待ちます。
何を使用しますか?
おそらく後者のオプションである--max-time
に興味があるでしょう。 。あなたの場合は900
に設定してください (15分)。
オプション--connect-timeout
を指定する 60
のようなものに (1分)も良い考えかもしれません。それ以外の場合はcurl
どうやら何らかのバックオフアルゴリズムを使用して、何度も接続を試みます。