The limit Statement
limit <value> {
[ statements ]
}
The limit statement limits the number of requests which are actively
being processed through a section. If too many requests are being
processed through the limit section, it immediately returns fail.
The <value> text can be a number, or a dynamic expansion, or an
attribute reference. The contents of <value> are interpreted as an
integer uint32 data type.
limit 4 {
foo
bar
}
In general, the best way to use limit is in conjunction with a
redundant block. In the following example, the configuration allows
4 packets to be outstanding in the proxy module. If more than 4
packets are outstanding, or if the proxy module fails, the
detail module is called.
redundant {
limit 4 {
proxy
}
detail
}
Limit with catch
In the following example, the configuration limits the concurrent
proxy requests to a maximum of 4. If the limit is hit, it returns
fail, which then runs catch fail, and writes to the detail file
instead.
recv Access-Request {
try {
limit 4 {
proxy
}
}
catch fail {
detail
}
}