The timeout Statement
Syntax
timeout <value> {
[ statements ]
}
Description
The timeout
statement limits the total time which a section can use
to process a particular request. If the request takes more than the
given time, it returns fail
.
The <value> text can be a number, or a dynamic expansion, or an
attribute reference. The contents of <value> are interpreted as a
time_delta
, with default scale in seconds.
The time scale can be changed by appending s
, us
, ms
, ns
, etc. as
with all uses of time_delta
values.
Example
timeout 1ms {
foo
bar
}
In general, the best way to use timeout
is in conjunction with a
redundant
block. In the following example, the configuration allows
the proxy
module to run for 4
seconds. If the proxy
module
takes more than 4
seconds to return, or if the proxy
module
fails, the detail
module is called.
Example using redundant
redundant
timeout 4s {
proxy
}
detail
}